Giter Club home page Giter Club logo

proxtv's Introduction

Hi there, I'm albarji! πŸ‘‹

My open-source interests are

  • πŸ€– Machine Learning
  • πŸ“š Natural Language Processing
  • πŸ–ΌοΈ Image Processing
  • πŸ€” Computational Creativity
  • πŸ”© Numerical Optimization
  • πŸ’» Computer Science in general!

profile for albarji on Stack Exchange, a network of free, community-driven Q&A sites

Codewars stats

Albarji's GitHub stats

proxtv's People

Contributors

albarji avatar fabianp avatar phcerdan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proxtv's Issues

3.3.0 pypi wheels are not valid manylinux wheels

This can be checked using auditwheel

$ auditwheel show prox_tv-3.3.0-cp37-cp37m-manylinux1_x86_64.whl
prox_tv-3.3.0-cp37-cp37m-manylinux1_x86_64.whl is consistent with the
following platform tag: "linux_x86_64".

The wheel references external versioned symbols in these system-
provided shared libraries: libstdc++.so.6 with versions {'CXXABI_1.3',
'GLIBCXX_3.4'}, libgomp-3300acd3.so.1.0.0 with versions {'GOMP_1.0',
'OMP_1.0'}, libc.so.6 with versions {'GLIBC_2.4', 'GLIBC_2.2.5',
'GLIBC_2.3'}, libm.so.6 with versions {'GLIBC_2.2.5'}, librt.so.1 with
versions {'GLIBC_2.2.5'}, libpthread.so.0 with versions
{'GLIBC_2.2.5', 'GLIBC_2.3.4'}

The following external shared libraries are required by the wheel:
{
    "libblas-2d5b9174.so.3.0.3": null,
    "libc.so.6": "/lib/libc-2.28.so",
    "libgcc_s.so.1": "/lib/libgcc_s.so.1",
    "libgfortran-bfa58d52.so.1.0.0": null,
    "libm.so.6": "/lib/libm-2.28.so",
    "libpthread.so.0": "/lib/libpthread-2.28.so",
    "librt.so.1": "/lib/librt-2.28.so",
    "libstdc++.so.6": "/lib/libstdc++.so.6.0.25"
}

In order to achieve the tag platform tag "manylinux1_x86_64" the
following shared library dependencies will need to be eliminated:

libblas-2d5b9174.so.3.0.3, libgfortran-bfa58d52.so.1.0.0

or by installing prox_tv==3.3.0 on an Arch Linux system and trying to import it:

$ python -c 'import prox_tv'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.7/site-packages/prox_tv/__init__.py", line 64, in <module>
    from _prox_tv import ffi, lib
ImportError: /usr/lib/python3.7/site-packages/_prox_tv.abi3.so: ELF load command address/offset not properly aligned

Bug in python tv1w_2d

Hi,

Python function tv1w_2d doesn't seem to be working, and outputs its input. Here's a pylab example I ranβ€―:

>>> a = -array([[1,2],[3,4]])/10
>>> tv1w_2d(a, array([[1,1]]), array([[1],[1]]))
array([[-0.1, -0.2],
       [-0.3, -0.4]])
>>> tv1_2d(a, 1)
array([[-0.25, -0.25],
       [-0.25, -0.25]])

I wasn't able to figure out the problem.

Prebundled Windows wheels

proxTV does not support Windows. We should extend the CI process to create python wheels in Windows. This should be doable through Appveyor.

Guide to installation under Windows + Matlab

It's not an issue, but more a guide to install the toolbox proxTV on Windows with Matlab (and compilation with VS2010) for those interested.
In the installation guide, before running the install script, perform these steps:

  1. Be sure that blas and lapack are installed. I use clapack v3.2.1.
  2. Modify the following files:
  • utils.h: append before lines 43-44 (defs of min and max functions) this block of preprocessor directives:
    #ifdef min
    #undef min
    #endif
    #ifdef max
    #undef max
    #endif

Root cause: on Windows min and max are already defined as macros, so deactivate them.

  • general.h:
    • line 12: insert before this line the directive #define _USE_MATH_DEFINES. Root cause: M_PI is not defined by default when including <math.h>
    • lines 18-28: there are several problems under Windows. First, the type lapack_int is not seen equivalent as integer, but they must be the same, all are long. lapack_int is compiled as ptrdiff_t, raising compilation errors in at the calls of dpttrf and dpttrs. Another problem is about lapack. With clapack, there are 2 header files, f2c.h and clapack.h. These files are not protected against c++ name mangling. To fix both problems, replace lines 18-28 with this block:
    #ifdef NOMATLAB
    #undef lapack_int
    #define lapack_int          integer
    #ifdef __cplusplus
    extern "C" {
    #endif
    #include <f2c.h>
    #include <clapack.h>
    #ifdef __cplusplus
    }
    #endif
    inline double mxGetInf() { return INFINITY; }
    #else
    #include "mex.h"
    #ifdef __cplusplus
    extern "C" {
    #endif
    #include "f2c.h"
    #include "clapack.h"
    #ifdef __cplusplus
    }
    #endif
    #include "matrix.h"
    #define lapack_int          integer
    #endif
  1. Modifications on install.m. I don't have put the include and lib directories of clapack in the path, so I must add the following options:
    • -I"path/to/clapack/inc" on every line calling mex.
    • replace all occurrences of -lblas -llapack -lm by -L"path/to/lapack/lib/Release" -lblas -lf2c -llapack.
      If you put clapack in the path, you don't need the -I and -L, but in all cases you need to replace -lm (not relevant with VC++) by -lf2c (libf2c.lib must be linked whenever you link lapack or blas).
      I don't use mwlapack, so I cannot tell you what to do to compile with this library.

Once you have done all of these instructions, run install, and the toolbox is installed!

Typo in doc?

The documentation for DR2_TV states that it solves a problem of the form

min_w gam(f_1(w)+f_2(w)) + 0.5*norm(w)^2 -u^w

Is this a typo and it should read min_w gam(f_1(w)+f_2(w)) + 0.5*norm(w - u)^2 ?

Image color filter python demo fails

Upon running the demo_filter_image_color.py in prox-tv-3.1.1 the following error appears:

Traceback (most recent call last):
  File "demo_filter_image_color.py", line 22, in <module>
    F = ptv.tvgen(N,      [lam, lam],                  [1, 2],                   [1, 1])
  File "/home/alvaro/anaconda3/envs/python2/lib/python2.7/site-packages/prox_tv/_prox_tv.py", line 581, in tvgen
    ws = force_float_matrix(ws)
  File "/home/alvaro/anaconda3/envs/python2/lib/python2.7/site-packages/prox_tv/_prox_tv.py", line 217, in force_float_matrix
    if x.dtype != np.dtype('float64'):
AttributeError: 'list' object has no attribute 'dtype'

Missing docs for lapack pre-requisites

It would be useful to add to the docs that one necessary prerequisite is to install the system libraries related with LAPACK and its C bindings. In particular, under Linux systems the required packages are "liblapack-dev", "liblapacke-dev" and "g++".

pls help me in resolving this

In [4]: import prox_tv as ptv

ImportError Traceback (most recent call last)
in ()
----> 1 import prox_tv as ptv

/home/qpi2/anaconda3/lib/python3.6/site-packages/prox_tv/init.py in ()
62
63 import numpy as np
---> 64 from _prox_tv import ffi, lib
65
66 # The maximum number of returned info parameters.

ImportError: /home/qpi2/anaconda3/lib/python3.6/site-packages/_prox_tv.abi3.so: undefined symbol: __cxa_throw_bad_array_new_length

maximum relevant lambda for tv1_1d

For the TV1_1D case, it is well-known that the solution becomes completely constant at a finite value of lambda, which is (IIRC) the maximum absolute value of (D.Dt)^-1(Dx) (where D is the difference matrix). Such a function is easy to implement oneself, but perhaps it could be added as a helper function to prox_tv?

Weighted loss function

Hi,

We try to solve a fused lasso problem with a slightly different loss function. In our case the loss function is weighted as

min ||Wi(Xi-Yi)||^2 + lambda ....

To adapt proxTV to this case, do you think it will be feasible and simple for us to build up a new proximity operator based on the function tautString_TV1_Weighted?

Regards

David

Memory error in TV-L1W

Invalid memory access can arise in weighted L1 TV solver. This behavior can be observed in the following example (Matlab)

image = [.1, .2, .3, 
    .4, .5, .6, 
    7, 8, 9]'
w1 = [.1, .2, 
    .3, .4
    .5, .6]'
w2 = [.6, .5, .4
    .3, .2, .1]'

sol = TV(image, {w1, w2})

The memory error arises exactly in the tautString_TV1_Weighted method: on line 504 [0] it can happen that i=n and this would of course result into reading memory outside the bounds of y[ ].

(Bug reported by Josip Djolonga)

Second order total variation [feature request]

I'd like to use second-order total variation, as described in for example these couple of papers:
https://www.ipol.im/pub/art/2013/40/article.pdf
http://www.franklenzen.de/pdf/lenzen_et_al_ssvm2013.pdf

In other words, instead of trying to minimize sum of first derivative |x_i - x_i-1|, this would be minimizing second derivative |x_i - 2*x_i-1 + x_i-2| (in the simple 1d case)

This has really important applications to image inpainting and filtering; the second-order TV denoising tends to produce better results for natural gradients by not introducing steps into them as first-order TV does.

Is it possible to add this? Where to start? I like this library a lot but I'm not familiar enough with the implementation to know what needs to be modified to add this.

Out of date PyPi version

The version of prox-tv on PyPi doesn't have the fix for compilation on OS X in #15 . Could you update the PyPi version to include this important fix?

cannot install proxTV in python

[Anaconda2] C:\Users\karl>pip install prox-tv
Collecting prox-tv
Using cached prox_tv-3.1.1.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info\prox_tv.egg-info
writing requirements to pip-egg-info\prox_tv.egg-info\requires.txt
writing pip-egg-info\prox_tv.egg-info\PKG-INFO
writing top-level names to pip-egg-info\prox_tv.egg-info\top_level.txt
writing dependency_links to pip-egg-info\prox_tv.egg-info\dependency_links.t
xt
writing manifest file 'pip-egg-info\prox_tv.egg-info\SOURCES.txt'
warning: manifest_maker: standard file '-c' not found

running build_ext
building '_cffi__xeeb1e175x657f5e69' extension
creating c:\users\karl\appdata\local\temp\pip-build-phcqvm\prox-tv\prox_tv\_

pycache_\Release
creating c:\users\karl\appdata\local\temp\pip-build-phcqvm\prox-tv\prox_tv_
pycache_\Release\prox_tv
creating c:\users\karl\appdata\local\temp\pip-build-phcqvm\prox-tv\prox_tv_
pycache_\Release\prox_tv__pycache__
creating c:\users\karl\appdata\local\temp\pip-build-phcqvm\prox-tv\prox_tv_
pycache_\Release\src
C:\Users\karl\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python
9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DNOMATLAB=1 -Id:\u
sers\karl\anaconda2\include -Id:\users\karl\anaconda2\PC /Tcprox_tv__pycache__
cffi__xeeb1e175x657f5e69.c /Foc:\users\karl\appdata\local\temp\pip-build-phcqvm
\prox-tv\prox_tv__pycache
_\Release\prox_tv__pycache___cffi__xeeb1e175x657f5e
69.obj -fopenmp
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
cffi__xeeb1e175x657f5e69.c
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(327) : warning C4013: 'Conda
tChambollePock2_TV' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(435) : warning C4013: 'DR2L1
W_TV' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(541) : warning C4013: 'DR2_T
V' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(630) : warning C4013: 'FISTA
TVp' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(719) : warning C4013: 'FW_TV
p' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(808) : warning C4013: 'GPFW

TVp' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(897) : warning C4013: 'GP_TV
p' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(986) : warning C4013: 'OGP_T
Vp' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(1120) : warning C4013: 'PD2

TV' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(1254) : warning C4013: 'PD_T
V' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(1324) : warning C4013: 'PG_T
V2' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(1413) : warning C4013: 'PN_T
V1' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(1509) : warning C4013: 'PN_T
V1_Weighted' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(1565) : warning C4013: 'TV1D
denoise' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(1648) : warning C4013: 'Yang
2_TV' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(1704) : warning C4013: 'dp'
undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(1788) : warning C4013: 'more
PG_TV2' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(1858) : warning C4013: 'more
TV2' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(1915) : warning C4013: 'taut
String_TV1' undefined; assuming extern returning int
prox_tv__pycache___cffi__xeeb1e175x657f5e69.c(1979) : warning C4013: 'taut
String_TV1_Weighted' undefined; assuming extern returning int
C:\Users\karl\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python
9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DNOMATLAB=1 -Id:\u
sers\karl\anaconda2\include -Id:\users\karl\anaconda2\PC /Tpsrc/condat_fast_tv.c
pp /Foc:\users\karl\appdata\local\temp\pip-build-phcqvm\prox-tv\prox_tv__pycach
e
\Release\src/condat_fast_tv.obj -fopenmp
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
condat_fast_tv.cpp
C:\Users\karl\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python
9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DNOMATLAB=1 -Id:\u
sers\karl\anaconda2\include -Id:\users\karl\anaconda2\PC /Tpsrc/johnsonRyanTV.cp
p /Foc:\users\karl\appdata\local\temp\pip-build-phcqvm\prox-tv\prox_tv__pycache
_\Release\src/johnsonRyanTV.obj -fopenmp
cl : Command line warning D9002 : ignoring unknown option '-fopenmp'
johnsonRyanTV.cpp
c:\users\karl\appdata\local\temp\pip-build-phcqvm\prox-tv\src\johnsonRyanTV.
h(2) : error C2871: 'std' : a namespace with this name does not exist
src/johnsonRyanTV.cpp(4) : error C2871: 'std' : a namespace with this name d
oes not exist
Traceback (most recent call last):
File "", line 1, in
File "c:\users\karl\appdata\local\temp\pip-build-phcqvm\prox-tv\setup.py",
line 68, in
zip_safe=False,
File "d:\users\karl\anaconda2\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "d:\users\karl\anaconda2\lib\distutils\dist.py", line 953, in run_com
mands
self.run_command(cmd)
File "d:\users\karl\anaconda2\lib\distutils\dist.py", line 972, in run_com
mand
cmd_obj.run()
File "d:\users\karl\anaconda2\lib\site-packages\setuptools-19.4-py2.7.egg
setuptools\command\egg_info.py", line 186, in run
File "d:\users\karl\anaconda2\lib\site-packages\setuptools-19.4-py2.7.egg
setuptools\command\egg_info.py", line 209, in find_sources
File "d:\users\karl\anaconda2\lib\site-packages\setuptools-19.4-py2.7.egg
setuptools\command\egg_info.py", line 293, in run
File "d:\users\karl\anaconda2\lib\site-packages\setuptools-19.4-py2.7.egg
setuptools\command\egg_info.py", line 322, in add_defaults
File "d:\users\karl\anaconda2\lib\site-packages\setuptools-19.4-py2.7.egg
setuptools\command\sdist.py", line 120, in add_defaults
File "d:\users\karl\anaconda2\lib\distutils\cmd.py", line 312, in get_fina
lized_command
cmd_obj.ensure_finalized()
File "d:\users\karl\anaconda2\lib\distutils\cmd.py", line 109, in ensure_f
inalized
self.finalize_options()
File "d:\users\karl\anaconda2\lib\site-packages\setuptools-19.4-py2.7.egg
setuptools\command\build_py.py", line 33, in finalize_options
File "d:\users\karl\anaconda2\lib\distutils\command\build_py.py", line 46,
in finalize_options
('force', 'force'))
File "d:\users\karl\anaconda2\lib\distutils\cmd.py", line 298, in set_unde
fined_options
src_cmd_obj.ensure_finalized()
File "d:\users\karl\anaconda2\lib\distutils\cmd.py", line 109, in ensure_f
inalized
self.finalize_options()
File "c:\users\karl\appdata\local\temp\pip-build-phcqvm\prox-tv\setup.py",
line 19, in finalize_options
self.distribution.ext_modules = get_ext_modules()
File "c:\users\karl\appdata\local\temp\pip-build-phcqvm\prox-tv\setup.py",
line 11, in get_ext_modules
from prox_tv.prox_tv import ffi
File "c:\users\karl\appdata\local\temp\pip-build-phcqvm\prox-tv\prox_tv_

init
.py", line 1, in
from ._prox_tv import *
File "c:\users\karl\appdata\local\temp\pip-build-phcqvm\prox-tv\prox_tv_p
rox_tv.py", line 171, in
libraries=['lapack'])
File "d:\users\karl\anaconda2\lib\site-packages\cffi\api.py", line 405, in
verify
lib = self.verifier.load_library()
File "d:\users\karl\anaconda2\lib\site-packages\cffi\verifier.py", line 10
0, in load_library
self._compile_module()
File "d:\users\karl\anaconda2\lib\site-packages\cffi\verifier.py", line 19
6, in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
File "d:\users\karl\anaconda2\lib\site-packages\cffi\ffiplatform.py", line
38, in compile
outputfilename = _build(tmpdir, ext)
File "d:\users\karl\anaconda2\lib\site-packages\cffi\ffiplatform.py", line
65, in _build
raise VerificationError('%s: %s' % (e.class.name, e))
cffi.ffiplatform.VerificationError: CompileError: command 'C:\Users\karl
AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin
\amd64\cl.exe' failed with exit status 2

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in c:\users\karl\app
data\local\temp\pip-build-phcqvm\prox-tv

[Anaconda2] C:\Users\karl>

I am new with python. what does it mean?

Behaviour on Mac

Hello,

I have installed the proxTV package via pip on my mac running macOS Catalina.
When I apply the tv_1d filter to my data I observe some strange behaviour.
Could you please advise what I am doing wrong?

#pos_filt[::,0].dtype -> dtype('float64') flat_denoised = prox_tv.tv1_1d(pos_filt[::,0],w=1.)
index

Tag 3.2.2

Release next tag with the following new features (already in master)

  • Solved memory leak in FW_TVp.
  • Solved warnings about reaching end in non-void functions.

proxtv installation

sir,
I'm currently working on matlab to complete a project on ECG peak detection.I need the wtv solver to accomplish it.But i am unable to install it on a windows machine.please help me to fix the issues
The error i am facing is:
mex -v -c -cxx CXXOPTIMFLAGS=-O3 CXXFLAGS='$CXXFLAGS -fopenmp -fPIC' LDFLAGS='$LDFLAGS -fopenmp' ...

Control reaches end of non-void function

[13/16] Building CXX object src/CMakeFiles/proxTV.dir/TV2Dopt.cpp.o
Software/proxTV/src-proxTV/src/TVLPopt.cpp: In function β€˜int FW_TVp(double*, double, double*, double*, int, double, Workspace*)’:
Software/proxTV/src-proxTV/src/TVLPopt.cpp:1087:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
[14/16] Building CXX object src/CMakeFiles/proxTV.dir/TV2Dopt.cpp.o
Software/proxTV/src-proxTV/src/TVNDopt.cpp: In function β€˜int Yang3_TV(size_t, size_t, size_t, double*, double, double*, int, double*)’:
Software/proxTV/src-proxTV/src/TVNDopt.cpp:802:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

Correct integration with Travis

The current integration with travis does not build the package properly, because it lacks a travis.yml file! This should be corrected so that Travis messages make sense.

Cannot build on MacOS

I have tried to build on MacOS 10.10 (Yosemite) and it fails. Here are the steps that I've followed thus far and where it fails.

  • I first installed the prereq cffi

  • Then I tried to install the prox-tv package. Build failed when some lapack libraries were not found.

  • I built and installed BLAS and LAPACK

  • Running the manual build (python setup.py build) again I was able to continue past the previous errors, but then the process failed at the following step:

    clang++ -bundle -undefined dynamic_lookup 
    -L/usr/local/lib -L/usr/local/opt/sqlite/lib -isysroot
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/prox_tv/__pycache__/_cffi__xeeb1e175x657f5e69.o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/condat_fast_tv.o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/johnsonRyanTV.o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/LPopt.o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TV2Dopt.o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TV2DWopt.o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TVgenopt.o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TVL1opt.o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TVL1Wopt.o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TVL2opt.o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TVLPopt.o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/TVNDopt.o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/src/utils.o -llapack -o 
    /Users/mbell/Downloads/proxTV-master/prox_tv/__pycache__/_cffi__xeeb1e175x657f5e69.so -fopenmp
    ld: library not found for -lgomp
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

Documentation clarification; monitoring objective functional along iterations

Hi, thanks for sharing the code source.

First, I would like a clarification on the documentation, where problems and corresponding formulation are described. I understand that in line 1 and 4, the vertical bars in the expression |x_i - x_{i-1}| denotes the absolute value. But what about subsequent expressions with subscripted capital X, like |X_{i,:,:} - X_{i-1,:,:}|? My guess is that it is then a l1-norm; can you confirm this?

Second, I would like to know if it is possible to monitor the value of the objective functional which is minimized, along iterations?

Regards

cannot install on macOS or ubuntu

Building with 'Xcode Clang++'.
/usr/bin/xcrun -sdk macosx10.13 clang++ -c -DUSE_MEX_CMD -DMATLAB_MEX_FILE -I"/Applications/Matlab/MATLAB_R2017b.app/extern/include" -I"/Applications/Matlab/MATLAB_R2017b.app/simulink/include" -fno-common -arch x86_64 -mmacosx-version-min=10.9 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fobjc-arc -std=c++11 -stdlib=libc++ -O3 "/Users/vinith/Documents/DownloadedCodes/proxTV-master/matlab/solveTV1_condat.cpp" -o /var/folders/d3/2mszdryx5xgbh6l8cn0dlqyc0000gt/T/mex_14100380134723_1097/solveTV1_condat.o
/usr/bin/xcrun -sdk macosx10.13 clang++ -c -DUSE_MEX_CMD -DMATLAB_MEX_FILE -I"/Applications/Matlab/MATLAB_R2017b.app/extern/include" -I"/Applications/Matlab/MATLAB_R2017b.app/simulink/include" -fno-common -arch x86_64 -mmacosx-version-min=10.9 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fobjc-arc -std=c++11 -stdlib=libc++ -O3 "/Applications/Matlab/MATLAB_R2017b.app/extern/version/cpp_mexapi_version.cpp" -o /var/folders/d3/2mszdryx5xgbh6l8cn0dlqyc0000gt/T/mex_14100380134723_1097/cpp_mexapi_version.o
/usr/bin/xcrun -sdk macosx10.13 clang++ -Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.9 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -framework Cocoa -bundle -stdlib=libc++ -O -Wl,-exported_symbols_list,"/Applications/Matlab/MATLAB_R2017b.app/extern/lib/maci64/mexFunction.map" -Wl,-exported_symbols_list,"/Applications/Matlab/MATLAB_R2017b.app/extern/lib/maci64/c_exportsmexfileversion.map" /var/folders/d3/2mszdryx5xgbh6l8cn0dlqyc0000gt/T/mex_14100380134723_1097/solveTV1_condat.o /var/folders/d3/2mszdryx5xgbh6l8cn0dlqyc0000gt/T/mex_14100380134723_1097/cpp_mexapi_version.o ".o" -lblas -llapack -lm -L"/Applications/Matlab/MATLAB_R2017b.app/bin/maci64" -lmx -lmex -lmat -o solveTV1_condat.mexmaci64
Error using mex
clang: error: no such file or directory: '
.o'

Error in install (line 68)
mex -v -cxx -lblas -llapack -lm CXXOPTIMFLAGS=-O3 solveTV1_condat.cpp "*.o"

Weighted Objective of the library?

Hi,

Thank you for providing this great library.

I want to have a weighted objective in the first term in 1-dimensional weighted (l1) total variation denoising, such as:
min_x (0.5 ||W(x-y)||^2 + sum_i \lambda_i |x_i - x_(i-1)|) .

To do this, what kind of steps would you suggest? I notice the function tautString_TV1_Weighted is the C++ entry point, but just not sure which point I should touch. Any help is very appreciated!

Best,
Kingsley

Pytohn, no improvement using threads

Hi,
It seems that there is no time improvement using more that one thread. I got this output running demo_filter_image_threads.py

Filtering image with 1 threads...
Elapsed time 10.8898968697
Filtering image with 2 threads...
Elapsed time 10.8090248108
Filtering image with 3 threads...
Elapsed time 11.2589318752
Filtering image with 4 threads...
Elapsed time 11.0475809574
Filtering image with 5 threads...
Elapsed time 10.8515479565
Filtering image with 6 threads...
Elapsed time 11.0257458687
Filtering image with 7 threads...
Elapsed time 10.9600379467
Filtering image with 8 threads...
Elapsed time 10.906512022

Huber regularizer

Does the current implementation allow the user to use huber regularizer? Is it possible by modifying the C code of one or two routine such as ChambollePock or DR?

cannot install proxTV in matlab windows10

I am not very familiar with compiler. When I install proxTV, it comes out error like this:

What should I do to fix it? Thank you very much.

install
Installing proxTV...
Verbose mode is on.
Neither -compatibleArrayDims nor -largeArrayDims is selected.
Using -compatibleArrayDims. In the future, MATLAB will require the use of
-largeArrayDims and remove the -compatibleArrayDims option.
For more information:
http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
... Looking for compiler 'MinGW64 Compiler (C++)' ...
... Looking for environment variable 'MW_MINGW64_LOC' ...Yes ('C:\TDM-GCC-64').
... Looking for file 'C:\TDM-GCC-64\bin\g++.exe' ...Yes.
... Looking for folder 'C:\TDM-GCC-64' ...Yes.
Found installed compiler 'MinGW64 Compiler (C++)'.
Set PATH = C:\TDM-GCC-64\bin;C:\Program Files\MATLAB\R2015b\extern\include\win64;C:\Program Files\MATLAB\R2015b\extern\include;C:\Program Files\MATLAB\R2015b\simulink\include;C:\Program Files\MATLAB\R2015b\lib\win64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\MATLAB\R2015b\runtime\win64;C:\Program Files\MATLAB\R2015b\bin;C:\Program Files\MATLAB\R2015b\polyspace\bin;C:\TDM-GCC-64\bin
Set INCLUDE = C:\TDM-GCC-64\include;
Set LIB = C:\TDM-GCC-64\lib;;
Set MW_TARGET_ARCH = win64;
Set LIBPATH = C:\Program Files\MATLAB\R2015b\extern\lib\win64;

Options file details

Compiler location: C:\TDM-GCC-64\
Options file: C:\Users\karl\AppData\Roaming\MathWorks\MATLAB\R2015b\mex_C++_win64.xml
CMDLINE2 : C:\TDM-GCC-64\\bin\g++ -m64 -Wl,--no-undefined -fopenmp -shared -s -Wl,"C:\Program Files\MATLAB\R2015b/extern/lib/win64/mingw64/mexFunction.def" TVgenopt.obj TVL1opt.obj TVL1Wopt.obj TVL2opt.obj TVLPopt.obj TV2Dopt.obj TV2DWopt.obj TVNDopt.obj LPopt.obj utils.obj condat_fast_tv.obj johnsonRyanTV.obj   -L"C:\Program Files\MATLAB\R2015b\extern\lib\win64\mingw64" -llibmx -llibmex -llibmat -lm -llibmwlapack -llibmwblas -o TVgenopt.mexw64
CXX : C:\TDM-GCC-64\\bin\g++
COMPILER : C:\TDM-GCC-64\\bin\g++
DEFINES : -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE 
MATLABMEX : -DMATLAB_MEX_FILE 
CXXFLAGS : -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC
INCLUDE : -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include"
CXXOPTIMFLAGS : -O3
CXXDEBUGFLAGS : -g
LDXX : C:\TDM-GCC-64\\bin\g++
LINKER : C:\TDM-GCC-64\\bin\g++
LDFLAGS : -m64 -Wl,--no-undefined -fopenmp
LDTYPE : -shared
LINKEXPORT : -Wl,"C:\Program Files\MATLAB\R2015b/extern/lib/win64/mingw64/mexFunction.def"
LIBLOC : C:\Program Files\MATLAB\R2015b\extern\lib\win64\mingw64
LINKLIBS : -L"C:\Program Files\MATLAB\R2015b\extern\lib\win64\mingw64" -llibmx -llibmex -llibmat -lm -llibmwlapack -llibmwblas
LDOPTIMFLAGS : -s
LDDEBUGFLAGS : -g
OBJEXT : .obj
LDEXT : .mexw64
SETENV : set COMPILER=g++ 
            set COMPFLAGS=-c -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -DMATLAB_MEX_FILE  
            set OPTIMFLAGS=-O3 
            set DEBUGFLAGS=-g 
            set LINKER=g++ 
            set LINKFLAGS=-m64 -Wl,--no-undefined -fopenmp -shared -L"C:\Program Files\MATLAB\R2015b\extern\lib\win64\mingw64" -llibmx -llibmex -llibmat -lm -llibmwlapack -llibmwblas -Wl,"C:\Program Files\MATLAB\R2015b/extern/lib/win64/mingw64/mexFunction.def" 
            set LINKDEBUGFLAGS=-g
            set NAME_OUTPUT= -o "%OUTDIR%%MEX_NAME%%MEX_EXT%"
MINGWROOT : C:\TDM-GCC-64\
MATLABROOT : C:\Program Files\MATLAB\R2015b
ARCH : win64
SRC : F:\work_code\matlabToolBox\proxTV-master\src\TVgenopt.cpp;F:\work_code\matlabToolBox\proxTV-master\src\TVL1opt.cpp;F:\work_code\matlabToolBox\proxTV-master\src\TVL1Wopt.cpp;F:\work_code\matlabToolBox\proxTV-master\src\TVL2opt.cpp;F:\work_code\matlabToolBox\proxTV-master\src\TVLPopt.cpp;F:\work_code\matlabToolBox\proxTV-master\src\TV2Dopt.cpp;F:\work_code\matlabToolBox\proxTV-master\src\TV2DWopt.cpp;F:\work_code\matlabToolBox\proxTV-master\src\TVNDopt.cpp;F:\work_code\matlabToolBox\proxTV-master\src\LPopt.cpp;F:\work_code\matlabToolBox\proxTV-master\src\utils.cpp;F:\work_code\matlabToolBox\proxTV-master\src\condat_fast_tv.cpp;F:\work_code\matlabToolBox\proxTV-master\src\johnsonRyanTV.cpp
OBJ : TVgenopt.obj;TVL1opt.obj;TVL1Wopt.obj;TVL2opt.obj;TVLPopt.obj;TV2Dopt.obj;TV2DWopt.obj;TVNDopt.obj;LPopt.obj;utils.obj;condat_fast_tv.obj;johnsonRyanTV.obj
OBJS : TVgenopt.obj TVL1opt.obj TVL1Wopt.obj TVL2opt.obj TVLPopt.obj TV2Dopt.obj TV2DWopt.obj TVNDopt.obj LPopt.obj utils.obj condat_fast_tv.obj johnsonRyanTV.obj 
SRCROOT : F:\work_code\matlabToolBox\proxTV-master\src\TVgenopt
DEF : C:\Users\karl\AppData\Local\Temp\mex_193365832569327_1396\TVgenopt.def
EXP : TVgenopt.exp
LIB : TVgenopt.lib
EXE : TVgenopt.mexw64
ILK : TVgenopt.ilk
MANIFEST : TVgenopt.mexw64.manifest
TEMPNAME : TVgenopt
EXEDIR : 
EXENAME : TVgenopt
OPTIM : -O3
LINKOPTIM : -s
CMDLINE1_0 : C:\TDM-GCC-64\\bin\g++ -c -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\TVgenopt.cpp -o TVgenopt.obj
CMDLINE1_1 : C:\TDM-GCC-64\\bin\g++ -c -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\TVL1opt.cpp -o TVL1opt.obj
CMDLINE1_2 : C:\TDM-GCC-64\\bin\g++ -c -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\TVL1Wopt.cpp -o TVL1Wopt.obj
CMDLINE1_3 : C:\TDM-GCC-64\\bin\g++ -c -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\TVL2opt.cpp -o TVL2opt.obj
CMDLINE1_4 : C:\TDM-GCC-64\\bin\g++ -c -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\TVLPopt.cpp -o TVLPopt.obj
CMDLINE1_5 : C:\TDM-GCC-64\\bin\g++ -c -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\TV2Dopt.cpp -o TV2Dopt.obj
CMDLINE1_6 : C:\TDM-GCC-64\\bin\g++ -c -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\TV2DWopt.cpp -o TV2DWopt.obj
CMDLINE1_7 : C:\TDM-GCC-64\\bin\g++ -c -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\TVNDopt.cpp -o TVNDopt.obj
CMDLINE1_8 : C:\TDM-GCC-64\\bin\g++ -c -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\LPopt.cpp -o LPopt.obj
CMDLINE1_9 : C:\TDM-GCC-64\\bin\g++ -c -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\utils.cpp -o utils.obj
CMDLINE1_10 : C:\TDM-GCC-64\\bin\g++ -c -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\condat_fast_tv.cpp -o condat_fast_tv.obj
CMDLINE1_11 : C:\TDM-GCC-64\\bin\g++ -c -DMX_COMPAT_32   -m64 -DMATLAB_MEX_FILE  -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\johnsonRyanTV.cpp -o johnsonRyanTV.obj

Building with 'MinGW64 Compiler (C++)'.
C:\TDM-GCC-64\bin\g++ -c -DMX_COMPAT_32 -m64 -DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\TVgenopt.cpp -o TVgenopt.obj
F:\work_code\matlabToolBox\proxTV-master\src\TVgenopt.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
/**
^

C:\TDM-GCC-64\bin\g++ -c -DMX_COMPAT_32 -m64 -DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2015b/extern/include" -I"C:\Program Files\MATLAB\R2015b/simulink/include" -fexceptions -fno-omit-frame-pointer -fopenmp -fPIC -O3 F:\work_code\matlabToolBox\proxTV-master\src\TVL1opt.cpp -o TVL1opt.obj
Error using mex
F:\work_code\matlabToolBox\proxTV-master\src\TVL1opt.cpp:1:0:
warning: -fPIC ignored for target (all code is position
independent)
/**
^
F:\work_code\matlabToolBox\proxTV-master\src\TVL1opt.cpp: In
function 'int PN_TV1(double_, double, double_, double_, int,
double, Workspace_)':
F:\work_code\matlabToolBox\proxTV-master\src\TVL1opt.cpp:115:30:
error: 'dpttrf_' was not declared in this scope
dpttrf_(&nnp,aux,aux2,&rc);
^
F:\work_code\matlabToolBox\proxTV-master\src\TVL1opt.cpp:117:48:
error: 'dpttrs_' was not declared in this scope
dpttrs_(&nnp, &one, aux, aux2, w, &nnp, &rc);
^

Error in install (line 25)
mex -v -c -cxx CXXOPTIMFLAGS=-O3 CXXFLAGS='$CXXFLAGS
-fopenmp -fPIC' LDFLAGS='$LDFLAGS -fopenmp' ...

Precompiled distributions

Installing proxTV is messy because the wheel uploaded currently to PyPI is a package with the source code, that needs to be compiled at install time. This requires the end-user to have a development environment for C, C++ and Fortran configured, which is troublesome.

It would be better to upload wheels pre-compiled for each distribution. See https://packaging.python.org/tutorials/packaging-projects/ . Note that for linux a manylinux wheel is required for upload to PyPI, https://github.com/pypa/manylinux . Also, to avoid forcing the end-user to install dependencies (like openblas) we should make use of the auditwheel project: https://pypi.org/project/auditwheel/

The problem with the approach above is that creating a manylinux wheel requires working under an old toolchain, with CentOS 5 being the recommended OS. Unfortunately CentOS 5 does not include lapacke packages, thus making preventing compilation of this project. This is probably because the lapack version at CentOS 5 is lapack 1.3, which is very old. My attempts at manually installing a newer lapack version have also failed.

Once all of the above is done, it would also be helpful to configure travis to generate theses packages and upload them to PyPI automatically, see https://docs.travis-ci.com/user/deployment/pypi/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.