summaryrefslogtreecommitdiff
path: root/ot/lp/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'ot/lp/__init__.py')
-rw-r--r--ot/lp/__init__.py22
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