Skip to content

Commit a5930d3

Browse files
[MRG] Semi-relaxed (fused) gromov-wasserstein divergence and improvements of gromov-wasserstein solvers (#431)
* maj gw/ srgw/ generic cg solver * correct pep8 on current state * fix bug previous tests * fix pep8 * fix bug srGW constC in loss and gradient * fix doc html * fix doc html * start updating test_optim.py * update tests gromov and optim - plus fix gromov dependencies * add symmetry feature to entropic gw * add symmetry feature to entropic gw * add exemple for sr(F)GW matchings * small stuff * remove (reg,M) from line-search/ complete srgw tests with backend * remove backend repetitions / rename fG to costG/ fix innerlog to True * fix pep8 * take comments into account / new nx parameters still to test * factor (f)gw2 + test new backend parameters in ot.gromov + harmonize stopping criterions * split gromov.py in ot/gromov/ + update test_gromov with helper_backend functions * manual documentaion gromov * remove circular autosummary * trying stuff * debug documentation * alphabetic ordering of module * merge into branch * add note in entropic gw solvers --------- Co-authored-by: Rémi Flamary <[email protected]>
1 parent 263a36f commit a5930d3

24 files changed

+4964
-3090
lines changed

CONTRIBUTORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The contributors to this library are:
3636
* [Tanguy Kerdoncuff](https://hv0nnus.github.io/) (Sampled Gromov Wasserstein)
3737
* [Minhui Huang](https://mhhuang95.github.io) (Projection Robust Wasserstein Distance)
3838
* [Nathan Cassereau](https://github.com/ncassereau-idris) (Backends)
39-
* [Cédric Vincent-Cuaz](https://github.com/cedricvincentcuaz) (Graph Dictionary Learning)
39+
* [Cédric Vincent-Cuaz](https://github.com/cedricvincentcuaz) (Graph Dictionary Learning, semi-relaxed FGW)
4040
* [Eloi Tanguy](https://github.com/eloitanguy) (Generalized Wasserstein Barycenters)
4141
* [Camille Le Coz](https://www.linkedin.com/in/camille-le-coz-8593b91a1/) (EMD2 debug)
4242
* [Eduardo Fernandes Montesuma](https://eddardd.github.io/my-personal-blog/) (Free support sinkhorn barycenter)

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ POT provides the following generic OT solvers (links to examples):
4242
* [Wasserstein distance on the circle](https://pythonot.github.io/auto_examples/plot_compute_wasserstein_circle.html) [44, 45]
4343
* [Spherical Sliced Wasserstein](https://pythonot.github.io/auto_examples/sliced-wasserstein/plot_variance_ssw.html) [46]
4444
* [Graph Dictionary Learning solvers](https://pythonot.github.io/auto_examples/gromov/plot_gromov_wasserstein_dictionary_learning.html) [38].
45+
* [Semi-relaxed (Fused) Gromov-Wasserstein divergences](https://pythonot.github.io/auto_examples/gromov/plot_semirelaxed_fgw.html) [48].
4546
* [Several backends](https://pythonot.github.io/quickstart.html#solving-ot-with-multiple-backends) for easy use of POT with [Pytorch](https://pytorch.org/)/[jax](https://github.com/google/jax)/[Numpy](https://numpy.org/)/[Cupy](https://cupy.dev/)/[Tensorflow](https://www.tensorflow.org/) arrays.
4647

4748
POT provides the following Machine Learning related solvers:
@@ -300,4 +301,8 @@ Dictionary Learning](https://arxiv.org/pdf/2102.06555.pdf), International Confer
300301

301302
[45] Hundrieser, Shayan, Marcel Klatt, and Axel Munk. [The statistics of circular optimal transport.](https://arxiv.org/abs/2103.15426) Directional Statistics for Innovative Applications: A Bicentennial Tribute to Florence Nightingale. Singapore: Springer Nature Singapore, 2022. 57-82.
302303

303-
[46] Bonet, C., Berg, P., Courty, N., Septier, F., Drumetz, L., & Pham, M. T. (2023). [Spherical Sliced-Wasserstein](https://openreview.net/forum?id=jXQ0ipgMdU). International Conference on Learning Representations.
304+
[46] Bonet, C., Berg, P., Courty, N., Septier, F., Drumetz, L., & Pham, M. T. (2023). [Spherical Sliced-Wasserstein](https://openreview.net/forum?id=jXQ0ipgMdU). International Conference on Learning Representations.
305+
306+
[47] Chowdhury, S., & Mémoli, F. (2019). [The gromov–wasserstein distance between networks and stable network invariants](https://academic.oup.com/imaiai/article/8/4/757/5627736). Information and Inference: A Journal of the IMA, 8(4), 757-787.
307+
308+
[48] Cédric Vincent-Cuaz, Rémi Flamary, Marco Corneli, Titouan Vayer, Nicolas Courty (2022). [Semi-relaxed Gromov-Wasserstein divergence and applications on graphs](https://openreview.net/pdf?id=RShaMexjc-x). International Conference on Learning Representations (ICLR), 2022.

RELEASES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
## 0.8.3dev
44

55
#### New features
6-
6+
- Added feature to (Fused) Gromov-Wasserstein solvers herited from `ot.optim` to support relative and absolute loss variations as stopping criterions (PR #431)
7+
- Added feature to (Fused) Gromov-Wasserstein solvers to handle asymmetric matrices (PR #431)
8+
- Added semi-relaxed (Fused) Gromov-Wasserstein solvers in `ot.gromov` + examples (PR #431)
79
- Added the spherical sliced-Wasserstein discrepancy in `ot.sliced.sliced_wasserstein_sphere` and `ot.sliced.sliced_wasserstein_sphere_unif` + examples (PR #434)
810
- Added the Wasserstein distance on the circle in ``ot.lp.solver_1d.wasserstein_circle`` (PR #434)
911
- Added the Wasserstein distance on the circle (for p>=1) in `ot.lp.solver_1d.binary_search_circle` + examples (PR #434)

docs/cache_nbrun

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/source/_templates/module.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{{ underline }}
33

44
.. automodule:: {{ fullname }}
5+
:members:
56

67
{% block functions %}
78
{% if functions %}
@@ -12,6 +13,7 @@
1213
{% for item in functions %}
1314

1415
.. autofunction:: {{ item }}
16+
1517

1618
.. include:: backreferences/{{fullname}}.{{item}}.examples
1719

docs/source/all.rst

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,33 @@ API and modules
1313
:toctree: gen_modules/
1414
:template: module.rst
1515

16-
lp
16+
1717
backend
1818
bregman
19-
smooth
20-
gromov
21-
optim
2219
da
23-
dr
24-
utils
2520
datasets
21+
dr
22+
factored
23+
gaussian
24+
gromov
25+
lp
26+
optim
27+
partial
2628
plot
27-
stochastic
28-
unbalanced
2929
regpath
30-
partial
3130
sliced
31+
smooth
32+
stochastic
33+
unbalanced
34+
utils
3235
weak
33-
factored
34-
gaussian
36+
3537

36-
.. autosummary::
37-
:toctree: ../modules/generated/
38-
:template: module.rst
38+
Main :py:mod:`ot` functions
39+
--------------
3940

4041
.. automodule:: ot
4142
:members:
43+
44+
45+

docs/source/conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __getattr__(cls, name):
119119
#
120120
# This is also used if you do content translation via gettext catalogs.
121121
# Usually you set "language" from the command line for these cases.
122-
language = None
122+
language = "en"
123123

124124
# There are two options for replacing |today|: either, you set today to some
125125
# non-false value, then it is used:
@@ -341,6 +341,9 @@ def __getattr__(cls, name):
341341
# If true, do not generate a @detailmenu in the "Top" node's menu.
342342
#texinfo_no_detailmenu = False
343343

344+
autodoc_default_options = {'autosummary': True,
345+
'autosummary_imported_members': True}
346+
344347

345348
# Example configuration for intersphinx: refer to the Python standard library.
346349
intersphinx_mapping = {'python': ('https://docs.python.org/3', None),

examples/gromov/plot_gromov.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
==========================
44
Gromov-Wasserstein example
55
==========================
6-
76
This example is designed to show how to use the Gromov-Wassertsein distance
87
computation in POT.
98
"""

0 commit comments

Comments
 (0)