Skip to content

Commit 6d2a865

Browse files
authored
[MRG] Documentation update for solve_sample with geomloss (#579)
* update documenation geomloss * pep8
1 parent 299f560 commit 6d2a865

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ POT provides the following generic OT solvers (links to examples):
2020

2121
* [OT Network Simplex solver](https://pythonot.github.io/auto_examples/plot_OT_1D.html) for the linear program/ Earth Movers Distance [1] .
2222
* [Conditional gradient](https://pythonot.github.io/auto_examples/plot_optim_OTreg.html) [6] and [Generalized conditional gradient](https://pythonot.github.io/auto_examples/plot_optim_OTreg.html) for regularized OT [7].
23-
* Entropic regularization OT solver with [Sinkhorn Knopp Algorithm](https://pythonot.github.io/auto_examples/plot_OT_1D.html) [2] , stabilized version [9] [10] [34], greedy Sinkhorn [22] and [Screening Sinkhorn [26] ](https://pythonot.github.io/auto_examples/plot_screenkhorn_1D.html).
23+
* Entropic regularization OT solver with [Sinkhorn Knopp
24+
Algorithm](https://pythonot.github.io/auto_examples/plot_OT_1D.html) [2] ,
25+
stabilized version [9] [10] [34], lazy CPU/GPU solver from geomloss [60] [61], greedy Sinkhorn [22] and [Screening
26+
Sinkhorn [26]
27+
](https://pythonot.github.io/auto_examples/plot_screenkhorn_1D.html).
2428
* Bregman projections for [Wasserstein barycenter](https://pythonot.github.io/auto_examples/barycenters/plot_barycenter_lp_vs_entropic.html) [3], [convolutional barycenter](https://pythonot.github.io/auto_examples/barycenters/plot_convolutional_barycenter.html) [21] and unmixing [4].
2529
* Sinkhorn divergence [23] and entropic regularization OT from empirical data.
2630
* Debiased Sinkhorn barycenters [Sinkhorn divergence barycenter](https://pythonot.github.io/auto_examples/barycenters/plot_debiased_barycenter.html) [37]

ot/solvers.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,26 @@ def solve_sample(X_a, X_b, a=None, b=None, metric='sqeuclidean', reg=None, reg_t
10011001
# lazy OT plan
10021002
lazy_plan = res.lazy_plan
10031003
1004+
We also have a very efficient solver with compiled CPU/CUDA code using
1005+
geomloss/PyKeOps that can be used with the following code:
1006+
1007+
.. code-block:: python
1008+
1009+
# automatic solver
1010+
res = ot.solve_sample(xa, xb, a, b, reg=1.0, method='geomloss')
1011+
1012+
# force O(n) memory efficient solver
1013+
res = ot.solve_sample(xa, xb, a, b, reg=1.0, method='geomloss_online')
1014+
1015+
# force pre-computed cost matrix
1016+
res = ot.solve_sample(xa, xb, a, b, reg=1.0, method='geomloss_tensorized')
1017+
1018+
# use multiscale solver
1019+
res = ot.solve_sample(xa, xb, a, b, reg=1.0, method='geomloss_multiscale')
1020+
1021+
# One can play with speed (small scaling factor) and precision (scaling close to 1)
1022+
res = ot.solve_sample(xa, xb, a, b, reg=1.0, method='geomloss', scaling=0.5)
1023+
10041024
- **Quadratic regularized OT [17]** (when ``reg!=None`` and ``reg_type="L2"``):
10051025
10061026
.. math::

0 commit comments

Comments
 (0)