Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9d00f96

Browse files
[MRG] ot.lp reorganizing (#714)
* ot.lp reorganise to avoid def in __init__ * pr number + enabled pre-commit * added barycenter.py imports * fixed wrong import in ot.gmm * ruff fix attempt * removed ot bar contribs -> only o.lp reorganisation in this PR * add check_number_threads to ot/lp/__init__.py __all__ * update releases * made barycenter_solvers and network_simplex hidden + deprecated ot.lp.cvx * fix ref to lp.cvx in test * lp.cvx now imports barycenter and gives a warnings.warning * cvx import barycenter
1 parent 200322b commit 9d00f96

File tree

13 files changed

+1074
-1030
lines changed

13 files changed

+1074
-1030
lines changed

‎CONTRIBUTORS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The contributors to this library are:
4848
* [Camille Le Coz](https://www.linkedin.com/in/camille-le-coz-8593b91a1/) (EMD2 debug)
4949
* [Eduardo Fernandes Montesuma](https://eddardd.github.io/my-personal-blog/) (Free support sinkhorn barycenter)
5050
* [Theo Gnassounou](https://github.com/tgnassou) (OT between Gaussian distributions)
51-
* [Clément Bonet](https://clbonet.github.io) (Wassertstein on circle, Spherical Sliced-Wasserstein)
51+
* [Clément Bonet](https://clbonet.github.io) (Wasserstein on circle, Spherical Sliced-Wasserstein)
5252
* [Ronak Mehta](https://ronakrm.github.io) (Efficient Discrete Multi Marginal Optimal Transport Regularization)
5353
* [Xizheng Yu](https://github.com/x12hengyu) (Efficient Discrete Multi Marginal Optimal Transport Regularization)
5454
* [Sonia Mazelet](https://github.com/SoniaMaz8) (Template based GNN layers)

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ POT provides the following generic OT solvers (links to examples):
5151
* [Efficient Discrete Multi Marginal Optimal Transport Regularization](https://pythonot.github.io/auto_examples/others/plot_demd_gradient_minimize.html) [50].
5252
* [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.
5353
* [Smooth Strongly Convex Nearest Brenier Potentials](https://pythonot.github.io/auto_examples/others/plot_SSNB.html#sphx-glr-auto-examples-others-plot-ssnb-py) [58], with an extension to bounding potentials using [59].
54-
* Gaussian Mixture Model OT [69]
54+
* [Gaussian Mixture Model OT](https://pythonot.github.io/auto_examples/others/plot_GMMOT_plan.html#sphx-glr-auto-examples-others-plot-gmmot-plan-py) [69].
5555
* [Co-Optimal Transport](https://pythonot.github.io/auto_examples/others/plot_COOT.html) [49] and
5656
[unbalanced Co-Optimal Transport](https://pythonot.github.io/auto_examples/others/plot_learning_weights_with_COOT.html) [71].
5757
* Fused unbalanced Gromov-Wasserstein [70].

‎RELEASES.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Implement CG solvers for partial FGW (PR #687)
77
- Added feature `grad=last_step` for `ot.solvers.solve` (PR #693)
88
- Automatic PR labeling and release file update check (PR #704)
9+
- Reorganize sub-module `ot/lp/__init__.py` into separate files (PR #714)
910

1011
#### Closed issues
1112
- Fixed `ot.mapping` solvers which depended on deprecated `cvxpy` `ECOS` solver (PR #692, Issue #668)

‎ot/gmm.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .backend import get_backend
1313
from .lp import emd2, emd
1414
import numpy as np
15-
from .lp import dist
15+
from .utils import dist
1616
from .gaussian import bures_wasserstein_mapping
1717

1818

‎ot/gromov/_partial.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def partial_gromov_wasserstein(
185185
if m is None:
186186
m = min(np.sum(p), np.sum(q))
187187
elif m < 0:
188-
raise ValueError("Problem infeasible. Parameter m should be greater"" than 0.")
188+
raise ValueError("Problem infeasible. Parameter m should be greater than 0.")
189189
elif m > min(np.sum(p), np.sum(q)):
190190
raise ValueError(
191191
"Problem infeasible. Parameter m should lower or"
@@ -654,7 +654,7 @@ def partial_fused_gromov_wasserstein(
654654
if m is None:
655655
m = min(np.sum(p), np.sum(q))
656656
elif m < 0:
657-
raise ValueError("Problem infeasible. Parameter m should be greater"" than 0.")
657+
raise ValueError("Problem infeasible. Parameter m should be greater than 0.")
658658
elif m > min(np.sum(p), np.sum(q)):
659659
raise ValueError(
660660
"Problem infeasible. Parameter m should lower or"
@@ -1213,7 +1213,7 @@ def entropic_partial_gromov_wasserstein(
12131213
if m is None:
12141214
m = min(nx.sum(p), nx.sum(q))
12151215
elif m < 0:
1216-
raise ValueError("Problem infeasible. Parameter m should be greater"" than 0.")
1216+
raise ValueError("Problem infeasible. Parameter m should be greater than 0.")
12171217
elif m > min(nx.sum(p), nx.sum(q)):
12181218
raise ValueError(
12191219
"Problem infeasible. Parameter m should lower or"

‎ot/gromov/_quantized.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ def get_graph_partition(
375375
raise ValueError(
376376
f"""
377377
Unknown `part_method='{part_method}'`. Use one of:
378-
{'random', 'louvain', 'fluid', 'spectral', 'GW', 'FGW'}.
378+
{"random", "louvain", "fluid", "spectral", "GW", "FGW"}.
379379
"""
380380
)
381381
return nx.from_numpy(part, type_as=C0)
@@ -447,7 +447,7 @@ def get_graph_representants(C, part, rep_method="pagerank", random_state=0, nx=N
447447
raise ValueError(
448448
f"""
449449
Unknown `rep_method='{rep_method}'`. Use one of:
450-
{'random', 'pagerank'}.
450+
{"random", "pagerank"}.
451451
"""
452452
)
453453

@@ -953,7 +953,7 @@ def get_partition_and_representants_samples(
953953
else:
954954
raise ValueError(
955955
f"""
956-
Unknown `method='{method}'`. Use one of: {'random', 'kmeans'}
956+
Unknown `method='{method}'`. Use one of: {"random", "kmeans"}
957957
"""
958958
)
959959

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /