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
The sparse loss functions (and their equivalent classes) return nans when there is -inf in the input.
Example:
import torch import numpy as np from entmax import entmax15_loss, sparsemax_loss x = torch.rand(10, 5) y = torch.randint(0, 4, [10]) x[:, 4] = -np.inf entmax15_loss(x, y) # tensor([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan]) sparsemax_loss(x, y) # tensor([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan])
The text was updated successfully, but these errors were encountered:
https://github.com/deep-spin/entmax/blob/master/entmax/losses.py#L44
If anything in X is non-finite, it looks to me like this line will cause problems.
Sorry, something went wrong.
good catch!
That line was a bit faster in my quick experiments when compared to other approaches but it should be avoidable.
No branches or pull requests
The sparse loss functions (and their equivalent classes) return nans when there is -inf in the input.
Example:
The text was updated successfully, but these errors were encountered: