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

[WIP] Implementation of FUGW and UCOOT #677

Merged
merged 7 commits into from
Oct 14, 2024
Merged

Conversation

6Ulm
Copy link
Collaborator

@6Ulm 6Ulm commented Sep 18, 2024

Types of changes

This PR is dedicated to the implementation of
1.Fused Unbalanced GW (or more correctly, its lower bound)
2. (Fused) Unbalanced COOT.

Since their structures, it is enough to write a common template, then write a wrapper for each divergence.
More precisely, we create a method called fused_unbalanced_cross_spaces_divergence , in which

  • reg_type="independent" corresponds to (Fused) UCOOT. This yields unbalanced_co_optimal_transport method.
  • reg_type="joint" corresponds to FUGW. This yields fused_unbalanced_gromov_wasserstein method.

We also allow for unregularized approximation of FUGW and UCOOT, i.e. $\varepsilon = 0$, thanks to the Majorization-Minization ot.unbalanced.mm_unbalanced and ot.unbalanced.lbfgsb_unbalanced L-BFGS-B methods.

This implementation also allows for $2$ types of marginal penalization: Kullback-Leibler divergence and squared L2 norm. We also allow the cost to be sub-differentiable w.r.t the input matrices and reference distributions. This is implemented in unbalanced_co_optimal_transport2 and fused_unbalanced_gromov_wasserstein methods.

Motivation and context / Related issue

How has this been tested (if it applies)

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 18, 2024

Codecov Report

Attention: Patch coverage is 99.02057% with 10 lines in your changes missing coverage. Please review.

Project coverage is 96.99%. Comparing base (2aa8338) to head (d345e5c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #677      +/-   ##
==========================================
+ Coverage   96.88%   96.99%   +0.10%     
==========================================
  Files          93       96       +3     
  Lines       18166    19117     +951     
==========================================
+ Hits        17600    18542     +942     
- Misses        566      575       +9     

Copy link
Collaborator

@cedricvincentcuaz cedricvincentcuaz left a comment

Choose a reason for hiding this comment

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

Thanks a lot @6Ulm for this impressive work.
Follows some remarks and comments to conclude the PR.
You also forgot to update ot.gromov.__init__.py

ot/gromov/_unbalanced.py Outdated Show resolved Hide resolved
ot/gromov/_unbalanced.py Show resolved Hide resolved
ot/gromov/_unbalanced.py Outdated Show resolved Hide resolved
ot/gromov/_unbalanced.py Outdated Show resolved Hide resolved
ot/gromov/_unbalanced.py Outdated Show resolved Hide resolved
ot/gromov/_utils.py Show resolved Hide resolved
ot/solvers.py Outdated Show resolved Hide resolved
ot/utils.py Show resolved Hide resolved
ot/utils.py Show resolved Hide resolved
ot/utils.py Show resolved Hide resolved
Copy link
Collaborator

@cedricvincentcuaz cedricvincentcuaz left a comment

Choose a reason for hiding this comment

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

Thank you for your last updates, you are almost there ! follows small comments on the documentation to correct then we'll be able to merge with the main branch :)

ot/gromov/_utils.py Outdated Show resolved Hide resolved
ot/gromov/_utils.py Show resolved Hide resolved
ot/gromov/_utils.py Outdated Show resolved Hide resolved
ot/gromov/_unbalanced.py Outdated Show resolved Hide resolved
ot/gromov/_unbalanced.py Outdated Show resolved Hide resolved
ot/gromov/_unbalanced.py Outdated Show resolved Hide resolved
ot/gromov/_unbalanced.py Outdated Show resolved Hide resolved
ot/gromov/_unbalanced.py Outdated Show resolved Hide resolved
@cedricvincentcuaz cedricvincentcuaz merged commit 791137b into PythonOT:master Oct 14, 2024
15 of 16 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