diff options
-rw-r--r-- | examples/demo_optim_OTreg.py | 2 | ||||
-rw-r--r-- | ot/__init__.py | 18 | ||||
-rwxr-xr-x | setup.py | 23 |
3 files changed, 24 insertions, 19 deletions
diff --git a/examples/demo_optim_OTreg.py b/examples/demo_optim_OTreg.py index 9ffb02d..5e88bdb 100644 --- a/examples/demo_optim_OTreg.py +++ b/examples/demo_optim_OTreg.py @@ -40,7 +40,7 @@ def f(G): def df(G): # return G return np.log(G)+1 -reg=1e-3 +reg=1e-1 Greg=ot.optim.cg(a,b,M,reg,f,df,verbose=True) diff --git a/ot/__init__.py b/ot/__init__.py index 3cf3518..4c3c40e 100644 --- a/ot/__init__.py +++ b/ot/__init__.py @@ -1,17 +1,17 @@ # Python Optimal Transport toolbox # All submodules and packages -import utils -import datasets -import plot -import bregman -import da -import optim +from . import utils +from . import datasets +from . import plot +from . import bregman +from . import da +from . import optim # OT functions -from emd import emd -from bregman import sinkhorn,barycenter -from da import sinkhorn_lpl1_mm +from ot.emd import emd +from ot.bregman import sinkhorn,barycenter +from ot.da import sinkhorn_lpl1_mm # utils functions from utils import dist,unif @@ -1,10 +1,17 @@ #!/usr/bin/env python -from distutils.core import setup, Extension +from setuptools import setup, find_packages +from codecs import open +from os import path import numpy -#from Cython.Distutils import build_ext +from setuptools.extension import Extension from Cython.Build import cythonize + +here = path.abspath(path.dirname(__file__)) + + + import os #import glob @@ -17,16 +24,14 @@ setup(name='POT', version=version, description='Python Optimal Transport Library', long_description=README, - author=u'Remi Flamary', - author_email='remi.flamary@gmail.com', + author=u'Remi Flamary, Nicolas Courty', + author_email='remi.flamary@gmail.com, ncourty@gmail.com', url='https://github.com/rflamary/POT', - packages=['ot','ot.emd'], - ext_modules = cythonize(Extension( - "ot.emd.emd", # the extesion name + packages=find_packages(), + ext_modules = cythonize(Extension( + "ot.emd.emd", # the extension name sources=["ot/emd/emd.pyx", "ot/emd/EMD_wrap.cpp"], # the Cython source and # additional C++ source files - #extra_compile_args=['-fopenmp'], - #extra_link_args=['-fopenmp'], language="c++", # generate and compile C++ code, include_dirs=[numpy.get_include(),os.path.join(ROOT,'ot/emd')])), platforms=['linux','macosx','windows'], |