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

A question about your loss_coteaching function #4

Open
nihaomiao opened this issue Mar 4, 2019 · 4 comments
Open

A question about your loss_coteaching function #4

nihaomiao opened this issue Mar 4, 2019 · 4 comments

Comments

@nihaomiao
Copy link

nihaomiao commented Mar 4, 2019

Hello, I find that in your class "loss_coteaching", the parameters you passed are y_1, y_2, which are already the log_softmax results. But you then used the cross_entropy, which has combined the log_softmax and nll_loss. This will use log_softmax twice. I am not sure whether I am wrong. Or do this problem not occur in your pytorch version?
By the way, even though using log_softmax function twice, your code is still right~

@bbdamodaran
Copy link

I also observed the same issue, but I tested using log_softmax only once. I did not observe the difference in the results. Please let me know if you observe different results. One more issue is that in return function of loss, the loss value is normalized twice

@nihaomiao
Copy link
Author

OK~

@guixianjin
Copy link

I don't observe that y_1, y_2 are already the log_softmax results, have the code has been changed and fixed? @nihaomiao @bbdamodaran

@henrypickler
Copy link

This was fixed in 4d32d1c. Note that even if the results were already log_softmax transformed this would not change the results since applying log_softmax twice is the same as applying it only once. It also does not change the ordering for selecting samples for each model meaning it didn't had any effect other than a bit of extra computation.

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