-
Notifications
You must be signed in to change notification settings - Fork 506
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
An Error (RuntimeWarning: invalid value encountered in log) in ot.da.SinkhornL1lL2 after some iterations #311
Comments
@EnayatAria can you elaborate ? your 'to reproduce' section is missing |
Hi.
I have just updated the problem with a clearer title.
Looking forward to hearing from you
Thanks
…On Tue, Nov 16, 2021 at 3:19 PM Hicham Janati ***@***.***> wrote:
@EnayatAria <https://github.com/EnayatAria> can you elaborate ? your 'to
reproduce' section is missing
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#311 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALAEZF74JPVORVIITYA4USDUMJR77ANCNFSM5IEK756A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
can you provide a small code snippet to reproduce the error so i can debug it ? |
The code is a simple call of the function ot_base = ot.da.SinkhornL1l2Transport(reg_e=10000, reg_cl=100, max_iter=100, verbose=True) The error is not from the code, but from the input values; since it is working with another dataset. However, when I changed the data set it sends the error after a couple of iteration. |
To reproduce, the code and the datasets are updated in the first comment. |
These numerical errors are probably caused by the large values in your data, try normalizing them first or normalize the cost with the
hope this fixes your problem |
There should never be negative values in G along the optim iterations. It might come from the solver we should look into it. |
Thank you for the solution, but it just breaks the iterations and returns the final G with negative values from optim.py. I am wondering if the result would be the optimal solution for the general regularized OT problem. 'alpha' is 'None' when none of the conditions in the scalar_search_armijo function in lineserach.py is met. There is a comment above the last 'return' saying that # Failed to find a suitable step length. What does that mean? Does it mean that it can not converge? alpha values for the provided datasets returned from line_search_armijo in optim.py are iter alpha The code again sent the same error as already mentioned ....\site-packages\ot\optim.py:357: RuntimeWarning: invalid value encountered in log but this time does not stop. |
Thanks for the modifications. It is now working till iteration 13 but now there is another error in backend.py and then it stops the iterations. The result and the error for the given dataset are as follows: It. |Loss |Relative loss|Absolute loss
Using the source codes, I have just updated utils.py and put backend.py in ot folder. (backend.py was not already in my ot folder). is it a bug? or should I update other codes? |
Please when testing use an environement and install directly from the master repository. If you don't have backend it means that you are on an old version of POT |
Thank you for your effort and responsibility. it is working now! |
Using ot.da.SinkhornL1l2Transport for a domain adaptation problem, I faced an error as follows:
Datasets used:
Xs.txt
Xt.txt
ys.txt
** To Reproduce**
If you download the input files in C:\ , then the code is:
Result and Error
Checking the parameters, I found that the G matrix obtained in the optim.py code has negative values in the last iteration; due to the last update.
Please let me know how to solve the problem, or if I should provide more information.
Best,
Environment (please complete the following information):
pip
,conda
): pipThe text was updated successfully, but these errors were encountered: