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

Error in normalization of losses #5

Open
alexrame opened this issue Jun 9, 2020 · 0 comments
Open

Error in normalization of losses #5

alexrame opened this issue Jun 9, 2020 · 0 comments

Comments

@alexrame
Copy link

alexrame commented Jun 9, 2020

Hey, thanks for the nice work.
Just reading your code, and I think there is a mistake in normalizing logits without the true label.
probs /= (all_probs.sum(dim=1, keepdim=True) + 1e-8)
should rather be
probs /= (probs.sum(dim=1, keepdim=True) + 1e-8)
in relation_loss in the ensembles.py file

And then similarly, for example for cos reg_type,
probs = probs / torch.sqrt(((all_probs ** 2).sum(dim=1, keepdim=True) + 1e-8)) # l2 normed
should be
probs = probs / torch.sqrt(((probs ** 2).sum(dim=1, keepdim=True) + 1e-8)) # l2 normed
as far as I understood your paper

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

1 participant