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

loss is nan #2

Open
eeric opened this issue Apr 1, 2020 · 5 comments
Open

loss is nan #2

eeric opened this issue Apr 1, 2020 · 5 comments

Comments

@eeric
Copy link

eeric commented Apr 1, 2020

your example was right, but when batch_size was 128, loss was nan, actually it occur error on 36,37th line in circleloss.py.

@qianjinhao
Copy link
Owner

your example was right, but when batch_size was 128, loss was nan, actually it occur error on 36,37th line in circleloss.py.

One example in the code is a tensor with a batch size of 128, and the result is not nan, so did you use the 'cos' method to calculate the similarity?

@eeric
Copy link
Author

eeric commented Apr 2, 2020

yes.

@TinyZeaMays
Copy link

@qianjinhao
Copy link
Owner

@qianjinhao

You may use soft_plus and logsumexp instead.

https://github.com/TinyZeaMays/CircleLoss/blob/d002ecd0c7e395f6e39bf8a2a96fd05b83afa93f/circle_loss.py#L37

@qianjinhao

You may use soft_plus and logsumexp instead.

https://github.com/TinyZeaMays/CircleLoss/blob/d002ecd0c7e395f6e39bf8a2a96fd05b83afa93f/circle_loss.py#L37

Thanks for the reminder. Have you tested the difference between the two implementations?

@vodanhbk95
Copy link

vodanhbk95 commented Sep 10, 2020

@qianjinhao

You may use soft_plus and logsumexp instead.

https://github.com/TinyZeaMays/CircleLoss/blob/d002ecd0c7e395f6e39bf8a2a96fd05b83afa93f/circle_loss.py#L37

@TinyZeaMays Can you tell me what is the difference between your implement and @qianjinhao 's implement. Cause I think it's true formula for circle loss

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