From 2ccba4bf4bd0a13f82ffeb34c05e97c80466a030 Mon Sep 17 00:00:00 2001 From: RĂ©mi Flamary Date: Tue, 8 Nov 2016 09:19:30 +0100 Subject: travis CI --- ot/__init__.py | 1 + ot/bregman.py | 7 +++++-- ot/lp/__init__.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'ot') 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.]] -- cgit v1.2.3