Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can it be applied to multi-classification problems? #4

Open
bhdreamer opened this issue Jan 24, 2019 · 9 comments
Open

Can it be applied to multi-classification problems? #4

bhdreamer opened this issue Jan 24, 2019 · 9 comments

Comments

@bhdreamer
Copy link

for multi-classification, when p = softmax(x), Does GHMC_loss work?

@libuyu
Copy link
Owner

libuyu commented Jan 24, 2019

If applied on softmax cross entropy loss, the form needs modification. We haven't studied this yet. And if you have any good idea, welcome to discuss in mail. :)

@bhdreamer
Copy link
Author

If applied on softmax cross entropy loss, the form needs modification. We haven't studied this yet. And if you have any good idea, welcome to discuss in mail. :)
Thanks for your quick reply. I know less about single-stage detector, but I meet similar issues when training text sequence task in NLP.

@xialuxi
Copy link

xialuxi commented Jan 25, 2019

GD(g) = R ind(g) M
code: weights[inds] = tot / num_in_bin
where M?

@libuyu
Copy link
Owner

libuyu commented Jan 26, 2019

@xialuxi hello, M is the "n" in


and

Sorry for the different notation.

@xialuxi
Copy link

xialuxi commented Jan 28, 2019

Thank you for your explanation.

@xialuxi
Copy link

xialuxi commented Jan 28, 2019

momentum = 1.0

There will be problems with code calculation.

@libuyu
Copy link
Owner

libuyu commented Jan 28, 2019

Since the equation has the form sum[i+1] = mmt * sum[i] + (1 - mmt) * num[i],
momentum should have the range [0, 1). So if momentum = 1.0, the moving average will never be updated and is unresonable.

I will add a line to check if the value of momentum is valid. Thank you.

@xialuxi If you have more questions unrelated to "multi-classification", you'd better open a new issue :)

@xialuxi
Copy link

xialuxi commented Jan 28, 2019

ok

@longchuan1985
Copy link

@xialuxi hello, M is the "n" in

GHM_Detection/mmdetection/mmdet/core/loss/ghm_loss.py

Line 41 in 0b3917d

n = 0 # n valid bins

and
GHM_Detection/mmdetection/mmdet/core/loss/ghm_loss.py

Line 54 in 0b3917d

weights = weights / n

Sorry for the different notation.

why the n is not a fixed value, since the bins (or M) is fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants