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

inital loss is nan? #3

Open
yang0817manman opened this issue Apr 2, 2020 · 3 comments
Open

inital loss is nan? #3

yang0817manman opened this issue Apr 2, 2020 · 3 comments

Comments

@yang0817manman
Copy link

非常感谢你的分享。为什么我用你分享的loss进行试验,初始loss一直都是nan,无论怎么修改学习率都是nan?请问这是什么原因?

@qianjinhao
Copy link
Owner

非常感谢你的分享。为什么我用你分享的loss进行试验,初始loss一直都是nan,无论怎么修改学习率都是nan?请问这是什么原因?

你是不是用cos度量相似度?我目前在mnist上可以训练,没有出现nan,但效果不好。欢迎指出我代码的问题和提交修改。

@yang0817manman
Copy link
Author

请问你有没有试过人脸数据或者行人,类别数特别多,我用你分享的loss试验人脸,调试发现loss_p为0,无论怎么修改参数,打印的loss总是nan或0? @qianjinhao

@sycophant-stone
Copy link

可以在这里添加 一个1e-10.
https://github.com/qianjinhao/circle-loss/blob/master/circle_loss.py#L38

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

3 participants