-
Notifications
You must be signed in to change notification settings - Fork 499
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
Assertion Error when using low-precision numbers #429
Comments
This problem comes back to bite us in the a** regularly. basically the numeircal solver in cython/c required some amount of precision that is tested in the function (or should be compensated) but it fails on some cases hard to reproduce. Could you give us a simple script where this happens please? |
I'm seeing a similar issue with code that is unfortunately a bit hard to reproduce... |
I am also facing this issue in my network in PyTorch where after sigmoid layer sum of inputs does not add to exactly 1.0 |
Hello I'm proposing a fix here with slightly easier assert condition and ability to skip the test. I'm planning on merging it shortly and then do a new release of POT. Feel free to test the fix and reopen the issue if it is not satisfactory. |
The PR is merged and there is now a new release. I'm closing this Issue, feel free to reopen it if you sill have the problem |
Describe the bug
Hello,
I used the 1d earth mover's distance function
ot.emd2_1d
to measure the distance between two outputs from a PyTorch neural network. With default parameters, all the numbers from the PyTorch model arefloat32
.The distance function raises an Assertion Error because of, what looks to me like a precision error.
Expected behavior
Is this the correct behaviour? If this 0.00000016 discrepancy changes the output of the function then I will have to reconsider using higher precision numbers. However, if this doesn't impact the result too much, maybe changing this to a warning rather than an error would be good.
Environment (please complete the following information):
pip
,conda
): conda-forgeOutput of the following code snippet:
Output:
The text was updated successfully, but these errors were encountered: