Skip to content
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] Translation Invariant Sinkhorn for Unbalanced OT #676

Merged
merged 15 commits into from
Oct 16, 2024

Conversation

clbonet
Copy link
Contributor

@clbonet clbonet commented Sep 13, 2024

Types of changes

This PR aims to add the Translation Invariant Sinkhorn algorithm proposed in Faster Unbalanced Optimal Transport: Translation invariant Sinkhorn and 1-D Frank-Wolfe
to solve the Unbalanced OT problem.

  • Added the function sinkhorn_unbalanced_translation_invariant in unbalanced/_sinkhorn.py
  • Added an example in plot_conv_sinkhorn_ti.py to demonstrate the convergence benefits
  • Added the method in unbalanced/test_sinkhorn.py

Motivation and context / Related issue

This version of Sinkhorn converges faster than the classical Sinkhorn algorithm for UOT.

How has this been tested (if it applies)

The function can be called by using the method "sinkhorn_translation_invariant" in sinkhorn_unbalanced, so I added this method in the itertools of tests of unbalanced/test_sinkhorn.py.

PR checklist

  • I have read the CONTRIBUTING document.
  • The documentation is up-to-date with the changes I made (check build artifacts).
  • All tests passed, and additional code has been covered with new tests.
  • I have added the PR and Issue fix to the RELEASES.md file.

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.03%. Comparing base (791137b) to head (2331d19).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #676      +/-   ##
==========================================
+ Coverage   96.99%   97.03%   +0.04%     
==========================================
  Files          96       96              
  Lines       19117    19255     +138     
==========================================
+ Hits        18542    18685     +143     
+ Misses        575      570       -5     

Copy link
Collaborator

@rflamary rflamary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very ice thanks @clbonet ,

I have two comments about missing tests since you code handle infinite values it should be tested.

ot/unbalanced/_sinkhorn.py Show resolved Hide resolved
ot/unbalanced/_sinkhorn.py Show resolved Hide resolved
ot/unbalanced/_sinkhorn.py Show resolved Hide resolved
@clbonet clbonet changed the title [WIP] Translation Invariant Sinkhorn for Unbalanced OT [MRG] Translation Invariant Sinkhorn for Unbalanced OT Sep 23, 2024
@rflamary
Copy link
Collaborator

Hello @clbonet ,

Sorry but we did another merging and now there is a conflict with your PR (only minor things such as reference number in redame and release file). Could you please have a quick look (and also update reference numbers in the doc of functions) so that we can finally merge

@rflamary rflamary merged commit 1a6c790 into PythonOT:master Oct 16, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants