diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2019-07-02 16:44:41 +0200 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2019-07-02 16:44:41 +0200 |
commit | 4053866fb2003d6a84353f6a7b209418608c25eb (patch) | |
tree | 387a454400c3c853a2b2d12fb51b725ce105a7c2 /ot/lp | |
parent | ef00ce42616fe7adf747c23a5590a83b62171a36 (diff) | |
parent | 8b3927bb5e8935c3dbddf054f054dc0c036fbdfe (diff) |
Merge branch 'master' into doc_modules
Diffstat (limited to 'ot/lp')
-rw-r--r-- | ot/lp/__init__.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/ot/lp/__init__.py b/ot/lp/__init__.py index 8bbd6d9..aed29f8 100644 --- a/ot/lp/__init__.py +++ b/ot/lp/__init__.py @@ -28,7 +28,7 @@ __all__=['emd', 'emd2', 'barycenter', 'free_support_barycenter', 'cvx', def emd(a, b, M, numItermax=100000, log=False): - """Solves the Earth Movers distance problem and returns the OT matrix + r"""Solves the Earth Movers distance problem and returns the OT matrix .. math:: @@ -83,8 +83,8 @@ def emd(a, b, M, numItermax=100000, log=False): >>> b=[.5,.5] >>> M=[[0.,1.],[1.,0.]] >>> ot.emd(a,b,M) - array([[ 0.5, 0. ], - [ 0. , 0.5]]) + array([[0.5, 0. ], + [0. , 0.5]]) References ---------- @@ -124,7 +124,7 @@ def emd(a, b, M, numItermax=100000, log=False): def emd2(a, b, M, processes=multiprocessing.cpu_count(), numItermax=100000, log=False, return_matrix=False): - """Solves the Earth Movers distance problem and returns the loss + r"""Solves the Earth Movers distance problem and returns the loss .. math:: \gamma = arg\min_\gamma <\gamma,M>_F @@ -326,7 +326,7 @@ def free_support_barycenter(measures_locations, measures_weights, X_init, b=None def emd_1d(x_a, x_b, a=None, b=None, metric='sqeuclidean', p=1., dense=True, log=False): - """Solves the Earth Movers distance problem between 1d measures and returns + r"""Solves the Earth Movers distance problem between 1d measures and returns the OT matrix @@ -392,11 +392,11 @@ def emd_1d(x_a, x_b, a=None, b=None, metric='sqeuclidean', p=1., dense=True, >>> x_a = [2., 0.] >>> x_b = [0., 3.] >>> ot.emd_1d(x_a, x_b, a, b) - array([[0. , 0.5], - [0.5, 0. ]]) + array([[0. , 0.5], + [0.5, 0. ]]) >>> ot.emd_1d(x_a, x_b) - array([[0. , 0.5], - [0.5, 0. ]]) + array([[0. , 0.5], + [0.5, 0. ]]) References ---------- @@ -446,7 +446,7 @@ def emd_1d(x_a, x_b, a=None, b=None, metric='sqeuclidean', p=1., dense=True, def emd2_1d(x_a, x_b, a=None, b=None, metric='sqeuclidean', p=1., dense=True, log=False): - """Solves the Earth Movers distance problem between 1d measures and returns + r"""Solves the Earth Movers distance problem between 1d measures and returns the loss @@ -541,7 +541,7 @@ def emd2_1d(x_a, x_b, a=None, b=None, metric='sqeuclidean', p=1., dense=True, def wasserstein_1d(x_a, x_b, a=None, b=None, p=1.): - """Solves the p-Wasserstein distance problem between 1d measures and returns + r"""Solves the p-Wasserstein distance problem between 1d measures and returns the distance |