Skip to content

Commit b2a7afb

Browse files
committed
merge new unbalanced
2 parents c698e0a + f251b4d commit b2a7afb

22 files changed

+1943
-877
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ coverage.xml
5959
*.mo
6060
*.pot
6161

62+
# xml
63+
*.xml
64+
6265
# Django stuff:
6366
*.log
6467
local_settings.py

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ matrix:
2525
# language: shell # 'language: python' is an error on Travis CI Windows
2626
# before_install: choco install python
2727
# env: PATH=/c/Python37:/c/Python37/Scripts:$PATH
28+
# before_script: # configure a headless display to test plot generation
29+
# - "export DISPLAY=:99.0"
30+
# - sleep 3 # give xvfb some time to start
2831
before_install:
2932
- ./.travis/before_install.sh
3033
# command to install dependencies
@@ -34,6 +37,8 @@ install:
3437
- pip install flake8 pytest "pytest-cov<2.6"
3538
- pip install .
3639
# command to run tests + check syntax style
40+
services:
41+
- xvfb
3742
script:
3843
- python setup.py develop
3944
- flake8 examples/ ot/ test/

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,7 @@ dist : wheels
8585
$(PYTHON) setup.py sdist
8686

8787

88+
pydocstyle :
89+
pydocstyle ot
90+
8891
FORCE :

docs/source/quickstart.rst

Lines changed: 97 additions & 51 deletions
Large diffs are not rendered by default.

examples/plot_barycenter_lp_vs_entropic.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
problems.append([A, [bary_l2, bary_wass, bary_wass2]])
103103

104104
##############################################################################
105-
# Dirac Data
105+
# Stair Data
106106
# ----------
107107

108108
#%% parameters
@@ -168,6 +168,11 @@
168168
pl.title('Barycenters')
169169
pl.tight_layout()
170170

171+
172+
##############################################################################
173+
# Dirac Data
174+
# ----------
175+
171176
#%% parameters
172177

173178
a1 = np.zeros(n)

examples/plot_free_support_barycenter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
pl.figure(1)
6363
for (x_i, b_i) in zip(measures_locations, measures_weights):
6464
color = np.random.randint(low=1, high=10 * N)
65-
pl.scatter(x_i[:, 0], x_i[:, 1], s=b * 1000, label='input measure')
65+
pl.scatter(x_i[:, 0], x_i[:, 1], s=b_i * 1000, label='input measure')
6666
pl.scatter(X[:, 0], X[:, 1], s=b * 1000, c='black', marker='^', label='2-Wasserstein barycenter')
6767
pl.title('Data measures and their barycenter')
6868
pl.legend(loc=0)

ot/__init__.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
3-
This is the main module of the POT toolbox. It provides easy access to
4-
a number of sub-modules and functions described below.
3+
This is the main module of the POT toolbox. It provides easy access to
4+
a number of sub-modules and functions described below.
55
66
.. note::
77
@@ -14,27 +14,27 @@
1414
- :any:`ot.lp` contains OT solvers for the exact (Linear Program) OT problems.
1515
- :any:`ot.smooth` contains OT solvers for the regularized (l2 and kl) smooth OT
1616
problems.
17-
- :any:`ot.gromov` contains solvers for Gromov-Wasserstein and Fused Gromov
17+
- :any:`ot.gromov` contains solvers for Gromov-Wasserstein and Fused Gromov
1818
Wasserstein problems.
19-
- :any:`ot.optim` contains generic solvers OT based optimization problems
19+
- :any:`ot.optim` contains generic solvers OT based optimization problems
2020
- :any:`ot.da` contains classes and function related to Monge mapping
2121
estimation and Domain Adaptation (DA).
2222
- :any:`ot.gpu` contains GPU (cupy) implementation of some OT solvers
23-
- :any:`ot.dr` contains Dimension Reduction (DR) methods such as Wasserstein
23+
- :any:`ot.dr` contains Dimension Reduction (DR) methods such as Wasserstein
2424
Discriminant Analysis.
25-
- :any:`ot.utils` contains utility functions such as distance computation and
26-
timing.
25+
- :any:`ot.utils` contains utility functions such as distance computation and
26+
timing.
2727
- :any:`ot.datasets` contains toy dataset generation functions.
2828
- :any:`ot.plot` contains visualization functions
2929
- :any:`ot.stochastic` contains stochastic solvers for regularized OT.
3030
- :any:`ot.unbalanced` contains solvers for regularized unbalanced OT.
3131
3232
.. warning::
33-
The list of automatically imported sub-modules is as follows:
33+
The list of automatically imported sub-modules is as follows:
3434
:py:mod:`ot.lp`, :py:mod:`ot.bregman`, :py:mod:`ot.optim`
3535
:py:mod:`ot.utils`, :py:mod:`ot.datasets`,
3636
:py:mod:`ot.gromov`, :py:mod:`ot.smooth`
37-
:py:mod:`ot.stochastic`
37+
:py:mod:`ot.stochastic`
3838
3939
The following sub-modules are not imported due to additional dependencies:
4040
@@ -65,17 +65,17 @@
6565
# OT functions
6666
from .lp import emd, emd2, emd_1d, emd2_1d, wasserstein_1d
6767
from .bregman import sinkhorn, sinkhorn2, barycenter
68-
from .unbalanced import sinkhorn_unbalanced, barycenter_unbalanced
68+
from .unbalanced import sinkhorn_unbalanced, barycenter_unbalanced, sinkhorn_unbalanced2
6969
from .da import sinkhorn_lpl1_mm
7070

7171
# utils functions
7272
from .utils import dist, unif, tic, toc, toq
7373

74-
__version__ = "1.0.0"
74+
__version__ = "0.6.0"
7575

76-
__all__ = ["emd", "emd2", 'emd_1d','emd2_1d', 'wasserstein_1d',
77-
"sinkhorn", "sinkhorn2", 'barycenter',
78-
'sinkhorn_lpl1_mm',
79-
'sinkhorn_unbalanced', "barycenter_unbalanced",
80-
'dist', 'unif', 'tic', 'toc', 'toq',
81-
"utils", 'datasets', 'bregman', 'lp', 'gromov', 'da', 'optim']
76+
__all__ = ['emd', 'emd2', 'emd_1d', 'sinkhorn', 'sinkhorn2', 'utils', 'datasets',
77+
'bregman', 'lp', 'tic', 'toc', 'toq', 'gromov',
78+
'emd_1d', 'emd2_1d', 'wasserstein_1d',
79+
'dist', 'unif', 'barycenter', 'sinkhorn_lpl1_mm', 'da', 'optim',
80+
'sinkhorn_unbalanced', 'barycenter_unbalanced',
81+
'sinkhorn_unbalanced2']

0 commit comments

Comments
 (0)