We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Dear author
Thank you for your carefully written code. I re-use your some codes, and I found out the error
please check the line 84 in prototypical_loss.py I think y_hat should be sequeezed with squeeze()
y_hat
squeeze()
y_hat and target_inds.squeeze() look like:
target_inds.squeeze()
y_hat = torch.tensor([[0],[1],[2],[0],[4]]) target_inds.squeeze() = torch.tensor([0, 1, 2, 3, 4])
In this case,
y_hat.eq(target_inds.squeeze()).float() tensor([[1., 0., 0., 0., 0.], [0., 1., 0., 0., 0.], [0., 0., 1., 0., 0.], [1., 0., 0., 0., 0.], [0., 0., 0., 0., 1.]])
In this case, accuracy is 0.2
It should be tensor([1., 1., 1., 0., 1.]). In this case, accuracy is 0.8
tensor([1., 1., 1., 0., 1.])
The text was updated successfully, but these errors were encountered:
Fix prototypical_loss bug orobix#23
58b72c3
Merge pull request #25 from rcy17/patch-1
df89808
Fix prototypical_loss bug #23
No branches or pull requests
Dear author
Thank you for your carefully written code.
I re-use your some codes, and I found out the error
please check the line 84 in prototypical_loss.py
I think
y_hat
should be sequeezed withsqueeze()
y_hat
andtarget_inds.squeeze()
look like:In this case,
In this case, accuracy is 0.2
It should be
tensor([1., 1., 1., 0., 1.])
.In this case, accuracy is 0.8
The text was updated successfully, but these errors were encountered: