|
| 1 | +POT: Python Optimal Transport |
| 2 | +============================= |
| 3 | + |
| 4 | +|Documentation Status| |
| 5 | + |
| 6 | +This open source Python library provide several solvers for optimization |
| 7 | +problems related to Optimal Transport for signal, image processing and |
| 8 | +machine learning. |
| 9 | + |
| 10 | +It provides the following solvers: |
| 11 | + |
| 12 | +- OT solver for the linear program/ Earth Movers Distance [1]. |
| 13 | +- Entropic regularization OT solver with Sinkhorn Knopp Algorithm [2]. |
| 14 | +- Bregman projections for Wasserstein barycenter [3] and unmixing [4]. |
| 15 | +- Optimal transport for domain adaptation with group lasso |
| 16 | + regularization [5] |
| 17 | +- Conditional gradient [6] and Generalized conditional gradient for |
| 18 | + regularized OT [7]. |
| 19 | +- Joint OT matrix and mapping etsimation [8]. |
| 20 | + |
| 21 | +Some demonstrations (both in Python and Jupyter Notebook format) are |
| 22 | +available in the examples folder. |
| 23 | + |
| 24 | +Installation |
| 25 | +------------ |
| 26 | + |
| 27 | +The Library has been tested on Linux and MacOSX. It requires a C++ |
| 28 | +compiler for using the EMD solver and rely on the following Python |
| 29 | +modules: |
| 30 | + |
| 31 | +- Numpy (>=1.11) |
| 32 | +- Scipy (>=0.17) |
| 33 | +- Cython (>=0.23) |
| 34 | +- Matplotlib (>=1.5) |
| 35 | + |
| 36 | +Under debian based linux the dependencies can be installed with |
| 37 | + |
| 38 | +:: |
| 39 | + |
| 40 | + sudo apt-get install python-numpy python-scipy python-matplotlib cython |
| 41 | + |
| 42 | +To install the library, you can install it locally (after downloading |
| 43 | +it) on you machine using |
| 44 | + |
| 45 | +:: |
| 46 | + |
| 47 | + python setup.py install --user |
| 48 | + |
| 49 | +The toolbox is also available on PyPI with a possibly slightly older |
| 50 | +version. You can install it with: |
| 51 | + |
| 52 | +:: |
| 53 | + |
| 54 | + pip install POT |
| 55 | + |
| 56 | +After a correct installation, you should be able to import the module |
| 57 | +without errors: |
| 58 | + |
| 59 | +.. code:: python |
| 60 | +
|
| 61 | + import ot |
| 62 | +
|
| 63 | +Note that for easier access the module is name ot instead of pot. |
| 64 | + |
| 65 | +Examples |
| 66 | +-------- |
| 67 | + |
| 68 | +The examples folder contain several examples and use case for the |
| 69 | +library. The full documentation is available on |
| 70 | +`Readthedocs <http://pot.readthedocs.io/>`__ |
| 71 | + |
| 72 | +Here is a list of the Python notebooks if you want a quick look: |
| 73 | + |
| 74 | +- `1D optimal |
| 75 | + transport <https://github.com/rflamary/POT/blob/master/examples/Demo_1D_OT.ipynb>`__ |
| 76 | +- `2D optimal transport on empirical |
| 77 | + distributions <https://github.com/rflamary/POT/blob/master/examples/Demo_2D_OT_samples.ipynb>`__ |
| 78 | +- `1D Wasserstein |
| 79 | + barycenter <https://github.com/rflamary/POT/blob/master/examples/Demo_1D_barycenter.ipynb>`__ |
| 80 | +- `OT with user provided |
| 81 | + regularization <https://github.com/rflamary/POT/blob/master/examples/Demo_Optim_OTreg.ipynb>`__ |
| 82 | +- `Domain adaptation with optimal |
| 83 | + transport <https://github.com/rflamary/POT/blob/master/examples/Demo_2D_OT_DomainAdaptation.ipynb>`__ |
| 84 | +- `Color transfer in |
| 85 | + images <https://github.com/rflamary/POT/blob/master/examples/Demo_Image_ColorAdaptation.ipynb>`__ |
| 86 | +- `OT mapping estimation for domain |
| 87 | + adaptation <https://github.com/rflamary/POT/blob/master/examples/Demo_2D_OTmapping_DomainAdaptation.ipynb>`__ |
| 88 | + |
| 89 | +Acknowledgements |
| 90 | +---------------- |
| 91 | + |
| 92 | +The contributors to this library are: |
| 93 | + |
| 94 | +- `Rémi Flamary <http://remi.flamary.com/>`__ |
| 95 | +- `Nicolas Courty <http://people.irisa.fr/Nicolas.Courty/>`__ |
| 96 | +- `Laetitia Chapel <http://people.irisa.fr/Laetitia.Chapel/>`__ |
| 97 | + |
| 98 | +This toolbox benefit a lot from open source research and we would like |
| 99 | +to thank the following persons for providing some code (in various |
| 100 | +languages): |
| 101 | + |
| 102 | +- `Gabriel Peyré <http://gpeyre.github.io/>`__ (Wasserstein Barycenters |
| 103 | + in Matlab) |
| 104 | +- `Nicolas Bonneel <http://liris.cnrs.fr/~nbonneel/>`__ ( C++ code for |
| 105 | + EMD) |
| 106 | +- `Antoine Rolet <https://arolet.github.io/>`__ ( Mex file for EMD ) |
| 107 | +- `Marco Cuturi <http://marcocuturi.net/>`__ (Sinkhorn Knopp in |
| 108 | + Matlab/Cuda) |
| 109 | + |
| 110 | +References |
| 111 | +---------- |
| 112 | + |
| 113 | +[1] Bonneel, N., Van De Panne, M., Paris, S., & Heidrich, W. (2011, |
| 114 | +December). Displacement interpolation using Lagrangian mass transport. |
| 115 | +In ACM Transactions on Graphics (TOG) (Vol. 30, No. 6, p. 158). ACM. |
| 116 | + |
| 117 | +[2] Cuturi, M. (2013). Sinkhorn distances: Lightspeed computation of |
| 118 | +optimal transport. In Advances in Neural Information Processing Systems |
| 119 | +(pp. 2292-2300). |
| 120 | + |
| 121 | +[3] Benamou, J. D., Carlier, G., Cuturi, M., Nenna, L., & Peyré, G. |
| 122 | +(2015). Iterative Bregman projections for regularized transportation |
| 123 | +problems. SIAM Journal on Scientific Computing, 37(2), A1111-A1138. |
| 124 | + |
| 125 | +[4] S. Nakhostin, N. Courty, R. Flamary, D. Tuia, T. Corpetti, |
| 126 | +Supervised planetary unmixing with optimal transport, Whorkshop on |
| 127 | +Hyperspectral Image and Signal Processing : Evolution in Remote Sensing |
| 128 | +(WHISPERS), 2016. |
| 129 | + |
| 130 | +[5] N. Courty; R. Flamary; D. Tuia; A. Rakotomamonjy, "Optimal Transport |
| 131 | +for Domain Adaptation," in IEEE Transactions on Pattern Analysis and |
| 132 | +Machine Intelligence , vol.PP, no.99, pp.1-1 |
| 133 | + |
| 134 | +[6] Ferradans, S., Papadakis, N., Peyré, G., & Aujol, J. F. (2014). |
| 135 | +Regularized discrete optimal transport. SIAM Journal on Imaging |
| 136 | +Sciences, 7(3), 1853-1882. |
| 137 | + |
| 138 | +[7] Rakotomamonjy, A., Flamary, R., & Courty, N. (2015). Generalized |
| 139 | +conditional gradient: analysis of convergence and applications. arXiv |
| 140 | +preprint arXiv:1510.06567. |
| 141 | + |
| 142 | +[8] M. Perrot, N. Courty, R. Flamary, A. Habrard, "Mapping estimation |
| 143 | +for discrete optimal transport", Neural Information Processing Systems |
| 144 | +(NIPS), 2016. |
| 145 | + |
| 146 | +.. |Documentation Status| image:: https://readthedocs.org/projects/pot/badge/?version=latest |
| 147 | + :target: http://pot.readthedocs.io/en/latest/?badge=latest |
0 commit comments