Skip to content

Commit 88054b5

Browse files
committed
update doc
1 parent 8933a84 commit 88054b5

File tree

1 file changed

+42
-39
lines changed

1 file changed

+42
-39
lines changed

docs/source/readme.rst

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ It provides the following solvers:
3939
- Screening Sinkhorn Algorithm for OT [26].
4040
- JCPOT algorithm for multi-source domain adaptation with target shift
4141
[27].
42+
- Partial Wasserstein and Gromov-Wasserstein (exact [29] and entropic
43+
[3] formulations).
4244

4345
Some demonstrations (both in Python and Jupyter Notebook format) are
4446
available in the examples folder.
@@ -51,12 +53,12 @@ POT using the following bibtex reference:
5153

5254
::
5355

54-
@misc{flamary2017pot,
55-
title={POT Python Optimal Transport library},
56-
author={Flamary, R{'e}mi and Courty, Nicolas},
57-
url={https://github.com/rflamary/POT},
58-
year={2017}
59-
}
56+
@misc{flamary2017pot,
57+
title={POT Python Optimal Transport library},
58+
author={Flamary, R{'e}mi and Courty, Nicolas},
59+
url={https://github.com/rflamary/POT},
60+
year={2017}
61+
}
6062

6163
Installation
6264
------------
@@ -78,19 +80,19 @@ be installed prior to installing POT. This can be done easily with
7880

7981
::
8082

81-
pip install numpy cython
83+
pip install numpy cython
8284

8385
You can install the toolbox through PyPI with:
8486

8587
::
8688

87-
pip install POT
89+
pip install POT
8890

8991
or get the very latest version by downloading it and then running:
9092

9193
::
9294

93-
python setup.py install --user # for user install (no root)
95+
python setup.py install --user # for user install (no root)
9496

9597
Anaconda installation with conda-forge
9698
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -101,7 +103,7 @@ required dependencies:
101103

102104
::
103105

104-
conda install -c conda-forge pot
106+
conda install -c conda-forge pot
105107

106108
Post installation check
107109
^^^^^^^^^^^^^^^^^^^^^^^
@@ -111,7 +113,7 @@ without errors:
111113

112114
.. code:: python
113115
114-
import ot
116+
import ot
115117
116118
Note that for easier access the module is name ot instead of pot.
117119

@@ -124,9 +126,9 @@ below
124126
- **ot.dr** (Wasserstein dimensionality reduction) depends on autograd
125127
and pymanopt that can be installed with:
126128

127-
::
129+
::
128130

129-
pip install pymanopt autograd
131+
pip install pymanopt autograd
130132

131133
- **ot.gpu** (GPU accelerated OT) depends on cupy that have to be
132134
installed following instructions on `this
@@ -142,36 +144,36 @@ Short examples
142144

143145
- Import the toolbox
144146

145-
.. code:: python
147+
.. code:: python
146148
147-
import ot
149+
import ot
148150
149151
- Compute Wasserstein distances
150152

151-
.. code:: python
153+
.. code:: python
152154
153-
# a,b are 1D histograms (sum to 1 and positive)
154-
# M is the ground cost matrix
155-
Wd=ot.emd2(a,b,M) # exact linear program
156-
Wd_reg=ot.sinkhorn2(a,b,M,reg) # entropic regularized OT
157-
# if b is a matrix compute all distances to a and return a vector
155+
# a,b are 1D histograms (sum to 1 and positive)
156+
# M is the ground cost matrix
157+
Wd=ot.emd2(a,b,M) # exact linear program
158+
Wd_reg=ot.sinkhorn2(a,b,M,reg) # entropic regularized OT
159+
# if b is a matrix compute all distances to a and return a vector
158160
159161
- Compute OT matrix
160162

161-
.. code:: python
163+
.. code:: python
162164
163-
# a,b are 1D histograms (sum to 1 and positive)
164-
# M is the ground cost matrix
165-
T=ot.emd(a,b,M) # exact linear program
166-
T_reg=ot.sinkhorn(a,b,M,reg) # entropic regularized OT
165+
# a,b are 1D histograms (sum to 1 and positive)
166+
# M is the ground cost matrix
167+
T=ot.emd(a,b,M) # exact linear program
168+
T_reg=ot.sinkhorn(a,b,M,reg) # entropic regularized OT
167169
168170
- Compute Wasserstein barycenter
169171

170-
.. code:: python
172+
.. code:: python
171173
172-
# A is a n*d matrix containing d 1D histograms
173-
# M is the ground cost matrix
174-
ba=ot.barycenter(A,M,reg) # reg is regularization parameter
174+
# A is a n*d matrix containing d 1D histograms
175+
# M is the ground cost matrix
176+
ba=ot.barycenter(A,M,reg) # reg is regularization parameter
175177
176178
Examples and Notebooks
177179
~~~~~~~~~~~~~~~~~~~~~~
@@ -282,11 +284,11 @@ References
282284
[1] Bonneel, N., Van De Panne, M., Paris, S., & Heidrich, W. (2011,
283285
December). `Displacement interpolation using Lagrangian mass
284286
transport <https://people.csail.mit.edu/sparis/publi/2011/sigasia/Bonneel_11_Displacement_Interpolation.pdf>`__.
285-
In ACM Transactions on Graphics (TOG) (Vol. 30, No. 6, p. 158). ACM.
287+
In ACM Transactions on Graphics (TOG) (Vol. 30, No. 6, p. 158). ACM.
286288

287289
[2] Cuturi, M. (2013). `Sinkhorn distances: Lightspeed computation of
288290
optimal transport <https://arxiv.org/pdf/1306.0895.pdf>`__. In Advances
289-
in Neural Information Processing Systems (pp. 2292-2300).
291+
in Neural Information Processing Systems (pp. 2292-2300).
290292

291293
[3] Benamou, J. D., Carlier, G., Cuturi, M., Nenna, L., & Peyré, G.
292294
(2015). `Iterative Bregman projections for regularized transportation
@@ -410,14 +412,15 @@ Shift <http://proceedings.mlr.press/v89/redko19a.html>`__, Proceedings
410412
of the Twenty-Second International Conference on Artificial Intelligence
411413
and Statistics (AISTATS) 22, 2019.
412414

413-
[28] Caffarelli, L. A., McCann, R. J. (2020). [Free boundaries in
414-
optimal transport and Monge-Ampere obstacle problems]
415-
(http://www.math.toronto.edu/~mccann/papers/annals2010.pdf), Annals of
416-
mathematics, 673-730.
415+
[28] Caffarelli, L. A., McCann, R. J. (2020). `Free boundaries in
416+
optimal transport and Monge-Ampere obstacle
417+
problems <http://www.math.toronto.edu/~mccann/papers/annals2010.pdf>`__,
418+
Annals of mathematics, 673-730.
417419

418-
[29] Chapel, L., Alaya, M., Gasso, G. (2019). [Partial
419-
Gromov-Wasserstein with Applications on Positive-Unlabeled Learning"]
420-
(https://arxiv.org/abs/2002.08276), arXiv preprint arXiv:2002.08276.
420+
[29] Chapel, L., Alaya, M., Gasso, G. (2019). `Partial
421+
Gromov-Wasserstein with Applications on Positive-Unlabeled
422+
Learning <https://arxiv.org/abs/2002.08276>`__, arXiv preprint
423+
arXiv:2002.08276.
421424

422425
.. |PyPI version| image:: https://badge.fury.io/py/POT.svg
423426
:target: https://badge.fury.io/py/POT

0 commit comments

Comments
 (0)