hichamjanati / mtw Goto Github PK
View Code? Open in Web Editor NEWWasserstein regularization for sparse multi-task regression
License: BSD 3-Clause "New" or "Revised" License
Wasserstein regularization for sparse multi-task regression
License: BSD 3-Clause "New" or "Revised" License
Hi, it seems the proximal update function is different from the paper. Line 48 in solver_cd.pyx shows:
z = theta - a - b
But in the paper the corresponding component in the derived proximal operator is:
z = theta - marginal*(b+1)
Hope you could help shed light on this.
Cheers,
Liu Peng
I get this:
(mtw-env) ❯ git status
On branch fix_more_ci
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: mtw/solver_cd.c
Untracked files:
(use "git add <file>..." to include in what will be committed)
doc/_build/
doc/auto_examples/
doc/generated/
mtw.egg-info/
maybe you should not track solver_cd.c
and all the sphinx things need to be ignored
(mtw-env) ➜ mtw git:(master) ✗ python
Python 3.7.1 | packaged by conda-forge | (default, Nov 13 2018, 18:33:04)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mtw import MTW
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/mathurin/workspace/mtw/mtw/__init__.py", line 1, in <module>
from .mtw import MTW
File "/home/mathurin/workspace/mtw/mtw/mtw.py", line 2, in <module>
from .solver import solver
File "/home/mathurin/workspace/mtw/mtw/solver.py", line 10, in <module>
from .otfunctions import (barycenterkl, barycenterkl_img, barycenterkl_log,
File "/home/mathurin/workspace/mtw/mtw/otfunctions.py", line 6, in <module>
from ot import emd2
ModuleNotFoundError: No module named 'ot'
@hichamjanati
What is ot
supposed to be ?
Hello -- thank you for making this project available.
I am running into some trouble trying to build and compile this:
(mtw) mtw (pep518)$pip install --no-deps -e .
WARNING: Missing build requirements in pyproject.toml for file:///Users/arokem/source/mtw.
WARNING: The project does not specify a build backend, and pip cannot fall back to setuptools without 'wheel'.
open errors.tx ERROR: Command errored out with exit status 1:
command: /Users/arokem/.virtualenvs/mtw/bin/python3.7 /Users/arokem/.virtualenvs/mtw/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/56/4s8_k8_s2n9c1622_bmnz7m40000gn/T/tmpjvb234qh
cwd: /Users/arokem/source/mtw
Complete output (1412 lines):
/private/var/folders/56/4s8_k8_s2n9c1622_bmnz7m40000gn/T/pip-build-env-w7qtokj_/overlay/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /Users/arokem/source/mtw/mtw/solver_cd.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
Error compiling Cython file:
------------------------------------------------------------
...
cimport cython
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:6:0: 'scipy/linalg/cython_blas.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cimport cython
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:6:0: 'scipy/linalg/cython_blas/ddot.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cimport cython
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:6:0: 'scipy/linalg/cython_blas/dasum.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cimport cython
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:6:0: 'scipy/linalg/cython_blas/daxpy.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cimport cython
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:6:0: 'scipy/linalg/cython_blas/dnrm2.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cimport cython
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:6:0: 'scipy/linalg/cython_blas/dcopy.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cimport cython
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:6:0: 'scipy/linalg/cython_blas/dscal.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
from scipy.linalg.cython_blas cimport sdot, sasum, saxpy, snrm2, scopy, sscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:7:0: 'scipy/linalg/cython_blas/sdot.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
from scipy.linalg.cython_blas cimport sdot, sasum, saxpy, snrm2, scopy, sscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:7:0: 'scipy/linalg/cython_blas/sasum.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
from scipy.linalg.cython_blas cimport sdot, sasum, saxpy, snrm2, scopy, sscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:7:0: 'scipy/linalg/cython_blas/saxpy.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
from scipy.linalg.cython_blas cimport sdot, sasum, saxpy, snrm2, scopy, sscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:7:0: 'scipy/linalg/cython_blas/snrm2.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
from scipy.linalg.cython_blas cimport sdot, sasum, saxpy, snrm2, scopy, sscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:7:0: 'scipy/linalg/cython_blas/scopy.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cimport numpy as np
import numpy as np
from cython cimport floating
from libc.math cimport fabs, sqrt, fmax
from scipy.linalg.cython_blas cimport ddot, dasum, daxpy, dnrm2, dcopy, dscal
from scipy.linalg.cython_blas cimport sdot, sasum, saxpy, snrm2, scopy, sscal
^
------------------------------------------------------------
mtw/solver_cd.pyx:7:0: 'scipy/linalg/cython_blas/sscal.pxd' not found
Error compiling Cython file:
------------------------------------------------------------
...
cdef floating fdot(int * n, floating * x, int * inc1, floating * y,
int * inc2) nogil:
if floating is double:
return ddot(n, x, inc1, y, inc2)
else:
return sdot(n, x, inc1, y, inc2)
^
------------------------------------------------------------
mtw/solver_cd.pyx:23:15: 'sdot' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
cdef floating fdot(int * n, floating * x, int * inc1, floating * y,
int * inc2) nogil:
if floating is double:
return ddot(n, x, inc1, y, inc2)
else:
return sdot(n, x, inc1, y, inc2)
^
------------------------------------------------------------
mtw/solver_cd.pyx:23:20: Cannot convert 'int *' to Python object
Error compiling Cython file:
------------------------------------------------------------
...
cdef floating fdot(int * n, floating * x, int * inc1, floating * y,
int * inc2) nogil:
if floating is double:
return ddot(n, x, inc1, y, inc2)
else:
return sdot(n, x, inc1, y, inc2)
^
------------------------------------------------------------
mtw/solver_cd.pyx:23:23: Cannot convert 'float *' to Python object
Error compiling Cython file:
------------------------------------------------------------
...
cdef floating fdot(int * n, floating * x, int * inc1, floating * y,
int * inc2) nogil:
if floating is double:
return ddot(n, x, inc1, y, inc2)
else:
return sdot(n, x, inc1, y, inc2)
^
------------------------------------------------------------
mtw/solver_cd.pyx:23:26: Cannot convert 'int *' to Python object
Error compiling Cython file:
------------------------------------------------------------
...
cdef floating fdot(int * n, floating * x, int * inc1, floating * y,
int * inc2) nogil:
if floating is double:
return ddot(n, x, inc1, y, inc2)
else:
return sdot(n, x, inc1, y, inc2)
^
------------------------------------------------------------
mtw/solver_cd.pyx:23:32: Cannot convert 'float *' to Python object
Error compiling Cython file:
------------------------------------------------------------
...
cdef floating fdot(int * n, floating * x, int * inc1, floating * y,
int * inc2) nogil:
if floating is double:
return ddot(n, x, inc1, y, inc2)
else:
return sdot(n, x, inc1, y, inc2)
^
------------------------------------------------------------
mtw/solver_cd.pyx:23:35: Cannot convert 'int *' to Python object
Error compiling Cython file:
------------------------------------------------------------
...
return -1.0
cdef floating fdot(int * n, floating * x, int * inc1, floating * y,
int * inc2) nogil:
if floating is double:
return ddot(n, x, inc1, y, inc2)
^
------------------------------------------------------------
mtw/solver_cd.pyx:21:15: 'ddot' is not a constant, variable or function identifier
Error compiling Cython file:
------------------------------------------------------------
...
return -1.0
cdef floating fdot(int * n, floating * x, int * inc1, floating * y,
int * inc2) nogil:
if floating is double:
return ddot(n, x, inc1, y, inc2)
^
------------------------------------------------------------
mtw/solver_cd.pyx:21:20: Cannot convert 'int *' to Python object
Error compiling Cython file:
------------------------------------------------------------
...
return -1.0
cdef floating fdot(int * n, floating * x, int * inc1, floating * y,
int * inc2) nogil:
if floating is double:
return ddot(n, x, inc1, y, inc2)
^
------------------------------------------------------------
mtw/solver_cd.pyx:21:23: Cannot convert 'double *' to Python object
Error compiling Cython file:
------------------------------------------------------------
...
return -1.0
cdef floating fdot(int * n, floating * x, int * inc1, floating * y,
int * inc2) nogil:
if floating is double:
return ddot(n, x, inc1, y, inc2)
^
------------------------------------------------------------
mtw/solver_cd.pyx:21:26: Cannot convert 'int *' to Python object
Error compiling Cython file:
------------------------------------------------------------
...
return -1.0
cdef floating fdot(int * n, floating * x, int * inc1, floating * y,
int * inc2) nogil:
if floating is double:
return ddot(n, x, inc1, y, inc2)
...
There are files like .DS_blabla
from macosx and .pyx
that should not be there.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.