summaryrefslogtreecommitdiff
path: root/ot
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2016-11-08 09:19:30 +0100
committerRémi Flamary <remi.flamary@gmail.com>2016-11-08 09:19:30 +0100
commit2ccba4bf4bd0a13f82ffeb34c05e97c80466a030 (patch)
treee5adf6fb907cd95413759a917b58e5a398af197c /ot
parentdb70a830756eb5d6a9c3d76fefc479b5a3daade6 (diff)
travis CI
Diffstat (limited to 'ot')
-rw-r--r--ot/__init__.py1
-rw-r--r--ot/bregman.py7
-rw-r--r--ot/lp/__init__.py2
3 files changed, 7 insertions, 3 deletions
diff --git a/ot/__init__.py b/ot/__init__.py
index 08b57eb..a925a6f 100644
--- a/ot/__init__.py
+++ b/ot/__init__.py
@@ -1,5 +1,6 @@
"""Python Optimal Transport toolbox"""
+
# All submodules and packages
from . import lp
from . import bregman
diff --git a/ot/bregman.py b/ot/bregman.py
index 91c526a..568ead2 100644
--- a/ot/bregman.py
+++ b/ot/bregman.py
@@ -59,6 +59,7 @@ def sinkhorn(a,b, M, reg, numItermax = 1000, stopThr=1e-9, verbose=False, log=Fa
Examples
--------
+ >>> import ot
>>> a=[.5,.5]
>>> b=[.5,.5]
>>> M=[[0.,1.],[1.,0.]]
@@ -203,10 +204,11 @@ def sinkhorn_stabilized(a,b, M, reg, numItermax = 1000,tau=1e3, stopThr=1e-9,war
Examples
--------
+ >>> import ot
>>> a=[.5,.5]
>>> b=[.5,.5]
>>> M=[[0.,1.],[1.,0.]]
- >>> ot.sinkhorn(a,b,M,1)
+ >>> ot.bregman.sinkhorn_stabilized(a,b,M,1)
array([[ 0.36552929, 0.13447071],
[ 0.13447071, 0.36552929]])
@@ -394,10 +396,11 @@ def sinkhorn_epsilon_scaling(a,b, M, reg, numItermax = 100, epsilon0=1e4, numInn
Examples
--------
+ >>> import ot
>>> a=[.5,.5]
>>> b=[.5,.5]
>>> M=[[0.,1.],[1.,0.]]
- >>> ot.sinkhorn(a,b,M,1)
+ >>> ot.bregman.sinkhorn_epsilon_scaling(a,b,M,1)
array([[ 0.36552929, 0.13447071],
[ 0.13447071, 0.36552929]])
diff --git a/ot/lp/__init__.py b/ot/lp/__init__.py
index 2adf937..1e55f5a 100644
--- a/ot/lp/__init__.py
+++ b/ot/lp/__init__.py
@@ -45,7 +45,7 @@ def emd(a, b, M):
Simple example with obvious solution. The function emd accepts lists and
perform automatic conversion to numpy arrays
-
+ >>> import ot
>>> a=[.5,.5]
>>> b=[.5,.5]
>>> M=[[0.,1.],[1.,0.]]