-
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
[MRG] Fix Gradient scaling in Partial GW solver #602
Conversation
Hello @yikun-baio and thanks for the PR. You should not propose anew file but instead implement directly your fix in th existing files. This is important because we have many tests that checks that nothing else breaks and we can compare easily your modification with the old implementation. We will do a code review with @lchapel when this is done. |
Hello @rflamary, Thank you for your feedback. I apologize for not implementing the fix directly in the existing file and instead proposing a new file. This is my first time to contribute to a public project via a pull request. I just realized that my email settings were inadvertently blocking emails from GitHub, which caused me to delay seeing your message. Not sure if it's still needed, but I'll implement the fix as suggested and make sure it's done in an existing file for @lchapel's direct code review. Thank you very much for your guidance and I look forward to contributing more effectively in the future. Thank you for your understanding and patience. Sincerest regards, |
Hello @yikun-baio this is a friendly reminder to implement your fix directly in the code if possible. I used a rocket emoji in your previous question to say that we are interested but maybe you did not receive a notfication. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #602 +/- ##
=======================================
Coverage 96.68% 96.68%
=======================================
Files 85 85
Lines 16890 16890
=======================================
Hits 16330 16330
Misses 560 560 |
Hello @yikun-baio, Thank you for your PR. In order to proceed with the review, could you first implement @rflamary corrections ? and make sure that all tests pass. Then I have some doubts on the current implementation. Could you precise which inconsistency did you spot in the paper [29] ? This difference implies that the computation of the gradient in M = gwgrad_partial(C1, C2, G0) # Here we want the 4D-tensor product to match calculus -> missing *0.5
...
a = gwloss_partial(C1, C2, deltaG) # correct
b = 2 * np.sum(M * deltaG) # correct Then I agree on the fact that the initial transport plan should be admissible such as the one you proposed. I would suggest to store Best, |
Hello, Cédric
Please refer to the attached PDF. In Part 1, I explain the Linear Search problem and its solution. The solution I have derived is consistent with [29]. In Part 2, I go through the code related to the Line Search section. I have highlighted the important parts in red for your review. explaination of the linear search.pdf
Based on the pdf, I think it should be changed to the following:
Could you take a look if my understanding is correct? Thanks, |
Hello @yikun-baio, Thank you for your contribution to POT :) |
Types of changes
I modify the code ot.partial.partial_gromov_wasserstein
Motivation and context / Related issue
There seems to be an inconsistency between ot.partial.partial_gromov_wasserstein and the line search section in the paper [29]. I fixed this section. In addition, I have made minor change to the initial guess in the partial-GW solver since the original initial guess is np.out(p,q), which might not be suitable for unbalanced case, i.e. |p|\neq |q|.
N/A
N/A
How has this been tested (if it applies)
PR checklist