@@ -36,6 +36,9 @@ It provides the following solvers:
36
36
problem [18] and dual problem [19])
37
37
- Non regularized free support Wasserstein barycenters [20].
38
38
- Unbalanced OT with KL relaxation distance and barycenter [10, 25].
39
+ - Screening Sinkhorn Algorithm for OT [26].
40
+ - JCPOT algorithm for multi-source domain adaptation with target shift
41
+ [27].
39
42
40
43
Some demonstrations (both in Python and Jupyter Notebook format) are
41
44
available in the examples folder.
@@ -48,19 +51,19 @@ POT using the following bibtex reference:
48
51
49
52
::
50
53
51
- @misc{flamary2017pot,
52
- title={POT Python Optimal Transport library},
53
- author={Flamary, R{'e}mi and Courty, Nicolas},
54
- url={https://github.com/rflamary/POT},
55
- year={2017}
56
- }
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
+ }
57
60
58
61
Installation
59
62
------------
60
63
61
64
The library has been tested on Linux, MacOSX and Windows. It requires a
62
- C++ compiler for using the EMD solver and relies on the following Python
63
- modules:
65
+ C++ compiler for building/installing the EMD solver and relies on the
66
+ following Python modules:
64
67
65
68
- Numpy (>=1.11)
66
69
- Scipy (>=1.0)
@@ -75,19 +78,19 @@ be installed prior to installing POT. This can be done easily with
75
78
76
79
::
77
80
78
- pip install numpy cython
81
+ pip install numpy cython
79
82
80
83
You can install the toolbox through PyPI with:
81
84
82
85
::
83
86
84
- pip install POT
87
+ pip install POT
85
88
86
89
or get the very latest version by downloading it and then running:
87
90
88
91
::
89
92
90
- python setup.py install --user # for user install (no root)
93
+ python setup.py install --user # for user install (no root)
91
94
92
95
Anaconda installation with conda-forge
93
96
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -98,7 +101,7 @@ required dependencies:
98
101
99
102
::
100
103
101
- conda install -c conda-forge pot
104
+ conda install -c conda-forge pot
102
105
103
106
Post installation check
104
107
^^^^^^^^^^^^^^^^^^^^^^^
@@ -108,7 +111,7 @@ without errors:
108
111
109
112
.. code :: python
110
113
111
- import ot
114
+ import ot
112
115
113
116
Note that for easier access the module is name ot instead of pot.
114
117
@@ -121,9 +124,9 @@ below
121
124
- **ot.dr ** (Wasserstein dimensionality reduction) depends on autograd
122
125
and pymanopt that can be installed with:
123
126
124
- ::
127
+ ::
125
128
126
- pip install pymanopt autograd
129
+ pip install pymanopt autograd
127
130
128
131
- **ot.gpu ** (GPU accelerated OT) depends on cupy that have to be
129
132
installed following instructions on `this
@@ -139,36 +142,36 @@ Short examples
139
142
140
143
- Import the toolbox
141
144
142
- .. code :: python
145
+ .. code :: python
143
146
144
- import ot
147
+ import ot
145
148
146
149
- Compute Wasserstein distances
147
150
148
- .. code :: python
151
+ .. code :: python
149
152
150
- # a,b are 1D histograms (sum to 1 and positive)
151
- # M is the ground cost matrix
152
- Wd= ot.emd2(a,b,M) # exact linear program
153
- Wd_reg= ot.sinkhorn2(a,b,M,reg) # entropic regularized OT
154
- # if b is a matrix compute all distances to a and return a vector
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
158
156
159
- Compute OT matrix
157
160
158
- .. code :: python
161
+ .. code :: python
159
162
160
- # a,b are 1D histograms (sum to 1 and positive)
161
- # M is the ground cost matrix
162
- T= ot.emd(a,b,M) # exact linear program
163
- T_reg= ot.sinkhorn(a,b,M,reg) # entropic regularized OT
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
164
167
165
168
- Compute Wasserstein barycenter
166
169
167
- .. code :: python
170
+ .. code :: python
168
171
169
- # A is a n*d matrix containing d 1D histograms
170
- # M is the ground cost matrix
171
- ba= ot.barycenter(A,M,reg) # reg is regularization parameter
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
172
175
173
176
Examples and Notebooks
174
177
~~~~~~~~~~~~~~~~~~~~~~
@@ -207,6 +210,10 @@ want a quick look:
207
210
Wasserstein <https://github.com/rflamary/POT/blob/master/notebooks/plot_gromov.ipynb> `__
208
211
- `Gromov Wasserstein
209
212
Barycenter <https://github.com/rflamary/POT/blob/master/notebooks/plot_gromov_barycenter.ipynb> `__
213
+ - `Fused Gromov
214
+ Wasserstein <https://github.com/rflamary/POT/blob/master/notebooks/plot_fgw.ipynb> `__
215
+ - `Fused Gromov Wasserstein
216
+ Barycenter <https://github.com/rflamary/POT/blob/master/notebooks/plot_barycenter_fgw.ipynb> `__
210
217
211
218
You can also see the notebooks with `Jupyter
212
219
nbviewer <https://nbviewer.jupyter.org/github/rflamary/POT/tree/master/notebooks/> `__.
@@ -237,6 +244,7 @@ The contributors to this library are
237
244
- `Vayer Titouan <https://tvayer.github.io/ >`__
238
245
- `Hicham Janati <https://hichamjanati.github.io/ >`__ (Unbalanced OT)
239
246
- `Romain Tavenard <https://rtavenar.github.io/ >`__ (1d Wasserstein)
247
+ - `Mokhtar Z. Alaya <http://mzalaya.github.io/ >`__ (Screenkhorn)
240
248
241
249
This toolbox benefit a lot from open source research and we would like
242
250
to thank the following persons for providing some code (in various
@@ -274,11 +282,11 @@ References
274
282
[1] Bonneel, N., Van De Panne, M., Paris, S., & Heidrich, W. (2011,
275
283
December). `Displacement interpolation using Lagrangian mass
276
284
transport <https://people.csail.mit.edu/sparis/publi/2011/sigasia/Bonneel_11_Displacement_Interpolation.pdf> `__.
277
- In ACM Transactions on Graphics (TOG) (Vol. 30, No. 6, p. 158). ACM.
285
+ In ACM Transactions on Graphics (TOG) (Vol. 30, No. 6, p. 158). ACM.
278
286
279
287
[2] Cuturi, M. (2013). `Sinkhorn distances: Lightspeed computation of
280
288
optimal transport <https://arxiv.org/pdf/1306.0895.pdf> `__. In Advances
281
- in Neural Information Processing Systems (pp. 2292-2300).
289
+ in Neural Information Processing Systems (pp. 2292-2300).
282
290
283
291
[3] Benamou, J. D., Carlier, G., Cuturi, M., Nenna, L., & Peyré, G.
284
292
(2015). `Iterative Bregman projections for regularized transportation
@@ -387,17 +395,29 @@ and Statistics, (AISTATS) 21, 2018
387
395
graphs <http://proceedings.mlr.press/v97/titouan19a.html> `__ Proceedings
388
396
of the 36th International Conference on Machine Learning (ICML).
389
397
390
- [25] Frogner C., Zhang C., Mobahi H., Araya-Polo M., Poggio T. (2019 ).
398
+ [25] Frogner C., Zhang C., Mobahi H., Araya-Polo M., Poggio T. (2015 ).
391
399
`Learning with a Wasserstein Loss <http://cbcl.mit.edu/wasserstein/ >`__
392
400
Advances in Neural Information Processing Systems (NIPS).
393
401
394
- [26] Caffarelli, L. A., McCann, R. J. (2020). `Free boundaries in optimal transport and
395
- Monge-Ampere obstacle problems <http://www.math.toronto.edu/~mccann/papers/annals2010.pdf> `__,
396
- Annals of mathematics, 673-730.
397
-
398
- [27] Chapel, L., Alaya, M., Gasso, G. (2019). `Partial Gromov-Wasserstein with Applications
399
- on Positive-Unlabeled Learning <https://arxiv.org/abs/2002.08276> `__. arXiv preprint
400
- arXiv:2002.08276.
402
+ [26] Alaya M. Z., Bérar M., Gasso G., Rakotomamonjy A. (2019).
403
+ `Screening Sinkhorn Algorithm for Regularized Optimal
404
+ Transport <https://papers.nips.cc/paper/9386-screening-sinkhorn-algorithm-for-regularized-optimal-transport> `__,
405
+ Advances in Neural Information Processing Systems 33 (NeurIPS).
406
+
407
+ [27] Redko I., Courty N., Flamary R., Tuia D. (2019). `Optimal Transport
408
+ for Multi-source Domain Adaptation under Target
409
+ Shift <http://proceedings.mlr.press/v89/redko19a.html> `__, Proceedings
410
+ of the Twenty-Second International Conference on Artificial Intelligence
411
+ and Statistics (AISTATS) 22, 2019.
412
+
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.
417
+
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.
401
421
402
422
.. |PyPI version | image :: https://badge.fury.io/py/POT.svg
403
423
:target: https://badge.fury.io/py/POT
0 commit comments