Skip to content

Commit feaecbe

Browse files
authored
Merge pull request #63 from rflamary/prV0.5
[MRG] Release 0.5
2 parents 8f6c455 + 27f0a9f commit feaecbe

File tree

64 files changed

+3906
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3906
-166
lines changed

.coveragerc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[run]
2+
3+
omit=
4+
ot/externals/*
5+
ot/externals/funcsigs.py
6+
ot/gpu/*

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ before_script: # configure a headless display to test plot generation
2626
# command to install dependencies
2727
install:
2828
- pip install -r requirements.txt
29-
- pip install flake8 pytest
29+
- pip install flake8 pytest pytest-cov
3030
- pip install .
3131
# command to run tests + check syntax style
3232
script:
3333
- python setup.py develop
3434
- flake8 examples/ ot/ test/
35-
- python -m pytest -v test/
35+
- python -m pytest -v test/ --cov=ot
3636
# - py.test ot test

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ GitHub, clone, and develop on a branch. Steps:
1717
a copy of the code under your GitHub user account. For more details on
1818
how to fork a repository see [this guide](https://help.github.com/articles/fork-a-repo/).
1919

20-
2. Clone your fork of the scikit-learn repo from your GitHub account to your local disk:
20+
2. Clone your fork of the POT repo from your GitHub account to your local disk:
2121

2222
```bash
2323
$ git clone [email protected]:YourLogin/POT.git
@@ -84,7 +84,7 @@ following rules before you submit a pull request:
8484
example script in the ``examples/`` folder. Have a look at other
8585
examples for reference. Examples should demonstrate why the new
8686
functionality is useful in practice and, if possible, compare it
87-
to other methods available in scikit-learn.
87+
to other methods available in POT.
8888

8989
- Documentation and high-coverage tests are necessary for enhancements to be
9090
accepted. Bug-fixes or new features should be provided with
@@ -145,7 +145,7 @@ following rules before submitting:
145145
See [Creating and highlighting code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks).
146146

147147
- Please include your operating system type and version number, as well
148-
as your Python, scikit-learn, numpy, and scipy versions. This information
148+
as your Python, POT, numpy, and scipy versions. This information
149149
can be found by running the following code snippet:
150150

151151
```python
@@ -165,8 +165,8 @@ following rules before submitting:
165165
New contributor tips
166166
--------------------
167167

168-
A great way to start contributing to scikit-learn is to pick an item
169-
from the list of [Easy issues](https://github.com/scikit-learn/scikit-learn/issues?labels=Easy)
168+
A great way to start contributing to POT is to pick an item
169+
from the list of [Easy issues](https://github.com/rflamary/POT/issues?labels=Easy)
170170
in the issue tracker. Resolving these issues allow you to start
171171
contributing to the project without much prior knowledge. Your
172172
assistance in this area will be greatly appreciated by the more
@@ -201,4 +201,4 @@ method does to the data and a figure (coming from an example)
201201
illustrating it.
202202

203203

204-
This Contrubution guide is strongly inpired by the one of the [scikit-learn](https://github.com/scikit-learn/scikit-learn) team.
204+
This Contribution guide is strongly inpired by the one of the [scikit-learn](https://github.com/scikit-learn/scikit-learn) team.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Anaconda Cloud](https://anaconda.org/conda-forge/pot/badges/version.svg)](https://anaconda.org/conda-forge/pot)
55
[![Build Status](https://travis-ci.org/rflamary/POT.svg?branch=master)](https://travis-ci.org/rflamary/POT)
66
[![Documentation Status](https://readthedocs.org/projects/pot/badge/?version=latest)](http://pot.readthedocs.io/en/latest/?badge=latest)
7+
[![Downloads](https://pepy.tech/badge/pot)](https://pepy.tech/project/pot)
78
[![Anaconda downloads](https://anaconda.org/conda-forge/pot/badges/downloads.svg)](https://anaconda.org/conda-forge/pot)
89
[![License](https://anaconda.org/conda-forge/pot/badges/license.svg)](https://github.com/rflamary/POT/blob/master/LICENSE)
910

@@ -79,7 +80,7 @@ Note that for easier access the module is name ot instead of pot.
7980

8081
Some sub-modules require additional dependences which are discussed below
8182

82-
* **ot.dr** (Wasserstein dimensionality rediuction) depends on autograd and pymanopt that can be installed with:
83+
* **ot.dr** (Wasserstein dimensionality reduction) depends on autograd and pymanopt that can be installed with:
8384
```
8485
pip install pymanopt autograd
8586
```

RELEASES.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,64 @@
11
# POT Releases
22

3+
4+
## 0.5.0 Year 2
5+
*Sep 2018*
6+
7+
POT is 2 years old! This release brings numerous new features to the
8+
toolbox as listed below but also several bug correction.
9+
10+
Among the new features, we can highlight a [non-regularized Gromov-Wasserstein
11+
solver](https://github.com/rflamary/POT/blob/master/notebooks/plot_gromov.ipynb),
12+
a new [greedy variant of sinkhorn](https://pot.readthedocs.io/en/latest/all.html#ot.bregman.greenkhorn),
13+
[non-regularized](https://pot.readthedocs.io/en/latest/all.html#ot.lp.barycenter),
14+
[convolutional (2D)](https://github.com/rflamary/POT/blob/master/notebooks/plot_convolutional_barycenter.ipynb)
15+
and [free support](https://github.com/rflamary/POT/blob/master/notebooks/plot_free_support_barycenter.ipynb)
16+
Wasserstein barycenters and [smooth](https://github.com/rflamary/POT/blob/prV0.5/notebooks/plot_OT_1D_smooth.ipynb)
17+
and [stochastic](https://pot.readthedocs.io/en/latest/all.html#ot.stochastic.sgd_entropic_regularization)
18+
implementation of entropic OT.
19+
20+
POT 0.5 also comes with a rewriting of ot.gpu using the cupy framework instead of
21+
the unmaintained cudamat. Note that while we tried to keed changes to the
22+
minimum, the OTDA classes were deprecated. If you are happy with the cudamat
23+
implementation, we recommend you stay with stable release 0.4 for now.
24+
25+
The code quality has also improved with 92% code coverage in tests that is now
26+
printed to the log in the Travis builds. The documentation has also been
27+
greatly improved with new modules and examples/notebooks.
28+
29+
This new release is so full of new stuff and corrections thanks to the old
30+
and new POT contributors (you can see the list in the [readme](https://github.com/rflamary/POT/blob/master/README.md)).
31+
32+
#### Features
33+
34+
* Add non regularized Gromov-Wasserstein solver (PR #41)
35+
* Linear OT mapping between empirical distributions and 90\% test coverage (PR #42)
36+
* Add log parameter in class EMDTransport and SinkhornLpL1Transport (PR #44)
37+
* Add Markdown format for Pipy (PR #45)
38+
* Test for Python 3.5 and 3.6 on Travis (PR #46)
39+
* Non regularized Wasserstein barycenter with scipy linear solver and/or cvxopt (PR #47)
40+
* Rename dataset functions to be more sklearn compliant (PR #49)
41+
* Smooth and sparse Optimal transport implementation with entropic and quadratic regularization (PR #50)
42+
* Stochastic OT in the dual and semi-dual (PR #52 and PR #62)
43+
* Free support barycenters (PR #56)
44+
* Speed-up Sinkhorn function (PR #57 and PR #58)
45+
* Add convolutional Wassersein barycenters for 2D images (PR #64)
46+
* Add Greedy Sinkhorn variant (Greenkhorn) (PR #66)
47+
* Big ot.gpu update with cupy implementation (instead of un-maintained cudamat) (PR #67)
48+
49+
#### Deprecation
50+
51+
Deprecated OTDA Classes were removed from ot.da and ot.gpu for version 0.5
52+
(PR #48 and PR #67). The deprecation message has been for a year here since
53+
0.4 and it is time to pull the plug.
54+
55+
#### Closed issues
56+
57+
* Issue #35 : remove import plot from ot/__init__.py (See PR #41)
58+
* Issue #43 : Unusable parameter log for EMDTransport (See PR #44)
59+
* Issue #55 : UnicodeDecodeError: 'ascii' while installing with pip
60+
61+
362
## 0.4 Community edition
463
*15 Sep 2017*
564

docs/cache_nbrun

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"plot_otda_mapping_colors_images.ipynb": "4f0587a00a3c082799a75a0ed36e9ce1", "plot_optim_OTreg.ipynb": "481801bb0d133ef350a65179cf8f739a", "plot_otda_color_images.ipynb": "d047d635f4987c81072383241590e21f", "plot_WDA.ipynb": "27f8de4c6d7db46497076523673eedfb", "plot_otda_linear_mapping.ipynb": "a472c767abe82020e0a58125a528785c", "plot_OT_L1_vs_L2.ipynb": "5d565b8aaf03be4309eba731127851dc", "plot_barycenter_1D.ipynb": "6063193f9ac87517acced2625edb9a54", "plot_otda_classes.ipynb": "39087b6e98217851575f2271c22853a4", "plot_otda_d2.ipynb": "e6feae588103f2a8fab942e5f4eff483", "plot_otda_mapping.ipynb": "2f1ebbdc0f855d9e2b7adf9edec24d25", "plot_gromov.ipynb": "24f2aea489714d34779521f46d5e2c47", "plot_compute_emd.ipynb": "f5cd71cad882ec157dc8222721e9820c", "plot_OT_1D.ipynb": "b5348bdc561c07ec168a1622e5af4b93", "plot_gromov_barycenter.ipynb": "953e5047b886ec69ec621ec52f5e21d1", "plot_otda_semi_supervised.ipynb": "f6dfb02ba2bbd939408ffcd22a3b007c", "plot_OT_2D_samples.ipynb": "07dbc14859fa019a966caa79fa0825bd", "plot_barycenter_lp_vs_entropic.ipynb": "51833e8c76aaedeba9599ac7a30eb357"}
1+
{"plot_otda_mapping_colors_images.ipynb": "4f0587a00a3c082799a75a0ed36e9ce1", "plot_optim_OTreg.ipynb": "481801bb0d133ef350a65179cf8f739a", "plot_barycenter_1D.ipynb": "5f6fb8aebd8e2e91ebc77c923cb112b3", "plot_stochastic.ipynb": "e2c520150378ae4635f74509f687fa01", "plot_WDA.ipynb": "27f8de4c6d7db46497076523673eedfb", "plot_otda_linear_mapping.ipynb": "a472c767abe82020e0a58125a528785c", "plot_OT_1D_smooth.ipynb": "3a059103652225a0c78ea53895cf79e5", "plot_OT_L1_vs_L2.ipynb": "5d565b8aaf03be4309eba731127851dc", "plot_otda_color_images.ipynb": "d047d635f4987c81072383241590e21f", "plot_otda_classes.ipynb": "39087b6e98217851575f2271c22853a4", "plot_otda_d2.ipynb": "e6feae588103f2a8fab942e5f4eff483", "plot_otda_mapping.ipynb": "2f1ebbdc0f855d9e2b7adf9edec24d25", "plot_gromov.ipynb": "24f2aea489714d34779521f46d5e2c47", "plot_compute_emd.ipynb": "f5cd71cad882ec157dc8222721e9820c", "plot_OT_1D.ipynb": "b5348bdc561c07ec168a1622e5af4b93", "plot_gromov_barycenter.ipynb": "953e5047b886ec69ec621ec52f5e21d1", "plot_free_support_barycenter.ipynb": "246dd2feff4b233a4f1a553c5a202fdc", "plot_convolutional_barycenter.ipynb": "a72bb3716a1baaffd81ae267a673f9b6", "plot_otda_semi_supervised.ipynb": "f6dfb02ba2bbd939408ffcd22a3b007c", "plot_OT_2D_samples.ipynb": "07dbc14859fa019a966caa79fa0825bd", "plot_barycenter_lp_vs_entropic.ipynb": "51833e8c76aaedeba9599ac7a30eb357"}

docs/source/all.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ ot.bregman
1919

2020
.. automodule:: ot.bregman
2121
:members:
22-
23-
ot.smooth
24-
-----
25-
.. automodule:: ot.smooth
26-
:members:
2722

2823
ot.smooth
2924
-----
Binary file not shown.
Binary file not shown.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

docs/source/auto_examples/index.rst

Lines changed: 88 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,46 @@ This is a gallery of all the POT example files.
4747

4848
/auto_examples/plot_optim_OTreg
4949

50+
.. raw:: html
51+
52+
<div class="sphx-glr-thumbcontainer" tooltip="Illustration of 2D Wasserstein barycenters if discributions that are weighted sum of diracs.">
53+
54+
.. only:: html
55+
56+
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_free_support_barycenter_thumb.png
57+
58+
:ref:`sphx_glr_auto_examples_plot_free_support_barycenter.py`
59+
60+
.. raw:: html
61+
62+
</div>
63+
64+
65+
.. toctree::
66+
:hidden:
67+
68+
/auto_examples/plot_free_support_barycenter
69+
70+
.. raw:: html
71+
72+
<div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the computation of EMD, Sinkhorn and smooth OT plans and their visuali...">
73+
74+
.. only:: html
75+
76+
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_OT_1D_smooth_thumb.png
77+
78+
:ref:`sphx_glr_auto_examples_plot_OT_1D_smooth.py`
79+
80+
.. raw:: html
81+
82+
</div>
83+
84+
85+
.. toctree::
86+
:hidden:
87+
88+
/auto_examples/plot_OT_1D_smooth
89+
5090
.. raw:: html
5191

5292
<div class="sphx-glr-thumbcontainer" tooltip="This example is designed to show how to use the Gromov-Wassertsein distance computation in POT....">
@@ -107,6 +147,26 @@ This is a gallery of all the POT example files.
107147

108148
/auto_examples/plot_compute_emd
109149

150+
.. raw:: html
151+
152+
<div class="sphx-glr-thumbcontainer" tooltip="This example is designed to illustrate how the Convolutional Wasserstein Barycenter function of...">
153+
154+
.. only:: html
155+
156+
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_convolutional_barycenter_thumb.png
157+
158+
:ref:`sphx_glr_auto_examples_plot_convolutional_barycenter.py`
159+
160+
.. raw:: html
161+
162+
</div>
163+
164+
165+
.. toctree::
166+
:hidden:
167+
168+
/auto_examples/plot_convolutional_barycenter
169+
110170
.. raw:: html
111171

112172
<div class="sphx-glr-thumbcontainer" tooltip=" ">
@@ -149,13 +209,13 @@ This is a gallery of all the POT example files.
149209

150210
.. raw:: html
151211

152-
<div class="sphx-glr-thumbcontainer" tooltip="This example presents a way of transferring colors between two image with Optimal Transport as ...">
212+
<div class="sphx-glr-thumbcontainer" tooltip="This example is designed to show how to use the stochatic optimization algorithms for descrete ...">
153213

154214
.. only:: html
155215

156-
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_otda_color_images_thumb.png
216+
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_stochastic_thumb.png
157217

158-
:ref:`sphx_glr_auto_examples_plot_otda_color_images.py`
218+
:ref:`sphx_glr_auto_examples_plot_stochastic.py`
159219

160220
.. raw:: html
161221

@@ -165,17 +225,17 @@ This is a gallery of all the POT example files.
165225
.. toctree::
166226
:hidden:
167227

168-
/auto_examples/plot_otda_color_images
228+
/auto_examples/plot_stochastic
169229

170230
.. raw:: html
171231

172-
<div class="sphx-glr-thumbcontainer" tooltip="OT for domain adaptation with image color adaptation [6] with mapping estimation [8].">
232+
<div class="sphx-glr-thumbcontainer" tooltip="This example presents a way of transferring colors between two image with Optimal Transport as ...">
173233

174234
.. only:: html
175235

176-
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_otda_mapping_colors_images_thumb.png
236+
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_otda_color_images_thumb.png
177237

178-
:ref:`sphx_glr_auto_examples_plot_otda_mapping_colors_images.py`
238+
:ref:`sphx_glr_auto_examples_plot_otda_color_images.py`
179239

180240
.. raw:: html
181241

@@ -185,7 +245,7 @@ This is a gallery of all the POT example files.
185245
.. toctree::
186246
:hidden:
187247

188-
/auto_examples/plot_otda_mapping_colors_images
248+
/auto_examples/plot_otda_color_images
189249

190250
.. raw:: html
191251

@@ -207,6 +267,26 @@ This is a gallery of all the POT example files.
207267

208268
/auto_examples/plot_barycenter_1D
209269

270+
.. raw:: html
271+
272+
<div class="sphx-glr-thumbcontainer" tooltip="OT for domain adaptation with image color adaptation [6] with mapping estimation [8].">
273+
274+
.. only:: html
275+
276+
.. figure:: /auto_examples/images/thumb/sphx_glr_plot_otda_mapping_colors_images_thumb.png
277+
278+
:ref:`sphx_glr_auto_examples_plot_otda_mapping_colors_images.py`
279+
280+
.. raw:: html
281+
282+
</div>
283+
284+
285+
.. toctree::
286+
:hidden:
287+
288+
/auto_examples/plot_otda_mapping_colors_images
289+
210290
.. raw:: html
211291

212292
<div class="sphx-glr-thumbcontainer" tooltip="This example presents how to use MappingTransport to estimate at the same time both the couplin...">

0 commit comments

Comments
 (0)