Rank: 456 based on 284 downloads (last 30 days) and 6 files submitted
photo

Stephen Becker

E-mail
Company/University
University of Paris 6

Personal Profile:

I'm a postdoc at UPMC in Paris. http://ugcs.caltech.edu/~srbecker

Professional Interests:
optimization, signal processing

 

Watch this Author's files

 

Files Posted by Stephen View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Jan 2013 Screenshot LBFGSB (L-BFGS-B) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. L-bfgs-b solves box-constrained optimization. Author: Stephen Becker optimization, constrained optimizat..., quasinewton, bfgs, bound constraints, nnls 94 33
  • 5.0
5.0 | 9 ratings
12 Dec 2012 Screenshot CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP). Author: Stephen Becker omp, cosamp, compressed sensing, compressive sampling, sparse, sparse recovery 141 13
  • 4.33333
4.3 | 6 ratings
23 Jul 2012 mex interface for bound constrained optimization via ASA ASA solves bound constrained problems; the user provides routines to calculate the function and grad Author: Stephen Becker bound constrained, optimization, constrained optimizat..., activeset, cg, nonlinear cg 23 0
29 Feb 2008 idctt type II Inverse DCT (i.e. type III DCT) Author: Stephen Becker spectral analysis, idct dct fft persiste... 12 0
26 Feb 2008 dctt type II DCT, improvement to matlab's dct Author: Stephen Becker spectral analysis, dct fft persistent sa... 9 0
Comments and Ratings by Stephen View all
Updated File Comments Rating
05 Aug 2013 LBFGSB (L-BFGS-B) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. L-bfgs-b solves box-constrained optimization. Author: Stephen Becker

Hi Roland,
That's great it works! If you wouldn't mind, can you post detailed instructions here? I think many others would find them useful.

You're right about the typo in the nrhs. I'll fix that in the next update.

Right now, the gradient is necessary. The Python and R versions use large packages to get around this. They might have a finite-differences gradient approximation mode, but I suspect they are really doing automatic differentiation (the good news is that this is the exact gradient, no approximation. The bad news is that it can be sometimes slow). There are automatic differentiation packages for Matlab, but none that seem to be very "mature". So you could try some of those, but if you can work out an explicit function to compute the gradient, that is usually the simplest (no automatic differentiation packages to get working) and the fastest for computation.
Best, Stephen

24 Jul 2013 LBFGSB (L-BFGS-B) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. L-bfgs-b solves box-constrained optimization. Author: Stephen Becker

Hi Roland,
I think that's with trying the f2c'd version of the code. It might be that your C compiler is stricter than the f2c code. Maybe you can tell the compiler to allow a newer standard? In gcc, it would be something like -std=gnu99 or -ansi. You can probably look up the equivalent for MSVC.
Or, if you can get a fortran compiler, then use the original fortran code and don't mess with the f2c version.
Either way, I'm afraid I can't help much because I work with a Windows computer. Judging from the other comments here, it is quite difficult to get this code to work with 64 it Windows. We really need a pure C version of the code; if you want to do this (you can use the f2c version as a base), please let me know!
Best,
Stephen

23 Jul 2013 CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP). Author: Stephen Becker

Israa, I'm not exactly sure what you want to do, but if you wish to work with 2D images, then use vectorize (e.g. use vec = @(x) x(:) ) and reshape operators, so that the code only sees vectors. If done right, it will work just fine. Hope that helps a bit.
-Stephen

30 Jun 2013 LBFGSB (L-BFGS-B) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. L-bfgs-b solves box-constrained optimization. Author: Stephen Becker

Hi Xin,
You are using the f2c version I included, so this adds more complication. The problem is almost surely that your BLAS requires integers of different lengths. So try two things:
First, define _BLAS64_ when you compile. You can do this by adding -D_BLAS64_ to the mex compilation command. Hopefully this will fix it.
Second, try a different BLAS. You can install another version (e.g. ATLAS) and use that. If there are still problems, use the netlib source code (for CBLAS) and link with this source; this way your compiler will give you errors if there are incompatibilities and they will be easy to fix.
Best, Stephen

08 Jun 2013 CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP). Author: Stephen Becker

Robin, that's a typo. It's an unimportant default value that doesn't affect the code, so I will change it the next time I have a major update.

Comments and Ratings on Stephen's Files View all
Updated File Comment by Comments Rating
17 Apr 2014 LBFGSB (L-BFGS-B) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. L-bfgs-b solves box-constrained optimization. Author: Stephen Becker Lucas

Hi everyone,

As I'm trying to compile the mex file on a W7 x64 with Matlab R2013a, I follow the tutorial of Daniel, and I would need some specification (thanks by the way for sharing this) :
- the line "lib /def:liblbfgsb.def /machine:x64" gives me
>>>
$ lib /def:liblbfgsb.def /machine:x64
-bash: lib: command not found
<<<

-I tried to run the compilation anyway, and it gives me this :
>>>
/cygdrive/c/Progra~1/MATLAB/R2013a/bin

$ mex.bat -O -largeArrayDims -UDEBUG lbfgsb_wrapper.c liblbfgsb.lib -lmex -lmx -lopenblas

C:\PROGRA~1\MATLAB\R2013A\BIN\MEX.PL: Error: 'lbfgsb_wrapper.c' not found.
<<<

I'm not a great expert on bash's command, and I can't figure out what's the real problem behind these.

-LS

09 Apr 2014 CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP). Author: Stephen Becker TDJIO

Thanks for sharing!

08 Apr 2014 CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP). Author: Stephen Becker sheng

Thank you very much for your share.

06 Jan 2014 LBFGSB (L-BFGS-B) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. L-bfgs-b solves box-constrained optimization. Author: Stephen Becker Daniel

Hi,

I succeded to compile and test the mex module for Windows 7 x64 (Sp1) linking with the multithreded OpenBlas. In this way one can take advantage of the multicore architecture of the available CPU. For the Windows operating system the process is rather convoluted and delicate (one can easily get into the so called "dll hell" problem). The solution is indeed based on creating a dll file. I got it working following a script from Roland, so many thanks to him who pioneered a way to compile using Cygwin and gracefully shared his own script.
The idea is the following:
1) install Openblas and add its lib folder to the $Path$ Environment variable.
2) install Cygwin64 (the Devel package)
3) make sure you have SDK 7.1 installed along with Visual Studio 10.0 (it's free) and all the updates for Win7.
4) add to the $Path$ environment variable "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64"
5) find and copy the x64 version of IESHIMS.dll into a folder added to $Path$ environment variable. (I know, this is counterintuitive and seems esoteric but if you don't it may not work) To check that this is needed one can use "Dependency Walker".
6) open the Cygwin64 terminal and go to the "lbfgsb3.0_mex1.2" folder and make sure the "Lbfgsb.3.0" subfolder with all its files is inside (if not download it).
7) Type (or creat a .sh script to run at once):
cd Lbfgsb.3.0
rm *.o
rm *.dll
rm *.lib
rm *.dll.a

x86_64-w64-mingw32-gfortran.exe -c -Wall -Wno-uninitialized lbfgsb.f linpack.f blas.f timer.f
echo EXPORTS > liblbfgsb.def
echo setulb_ >> liblbfgsb.def
echo _setulb_=setulb_ >> liblbfgsb.def

dlltool -D liblbfgsb.dll -d liblbfgsb.def -e liblbfgsb.o -l liblbfgsb.dll.a lbfgsb.o linpack.o blas.o timer.o
lib /def:liblbfgsb.def /machine:x64

x86_64-w64-mingw32-gfortran.exe -mdll -static-libgfortran -o liblbfgsb.dll liblbfgsb.o lbfgsb.o linpack.o timer.o blas.o

cp liblbfgsb.dll liblbfgsb.dll.a liblbfgsb.lib .
cp liblbfgsb.dll liblbfgsb.dll.a liblbfgsb.lib ..
cp /usr/x86_64-w64-mingw32/sys-root/mingw/bin/libgcc_s_seh-1.dll ..
cd ..

/cygdrive/c/Progra~1/MATLAB/R2013b/bin/mex.bat -O -largeArrayDims -UDEBUG lbfgsb_wrapper.c liblbfgsb.lib -lmex -lmx -lopenblas

8) Test example_NNLS.m

Good Luck!

27 Nov 2013 LBFGSB (L-BFGS-B) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. L-bfgs-b solves box-constrained optimization. Author: Stephen Becker Robert

Dear Chenchen Tong,

I got the same error, when running compile_mex.m on Ubuntu 12.04, gcc-4.6 and MATLAB R2013a:

=== lbfgsb "driver1" test problem, 2D ===
Invalid MEX-file
'.../lbfgsb.3.0_1.2/lbfgsb3.0_mex1.2/lbfgsb_wrapper.mexa64':'.../matlabR2013a/bin/glnxa64/../../sys/os/glnxa64/libgfortran.so.3: version
`GFORTRAN_1.4' not found (required by
.../lbfgsb.3.0_1.2/lbfgsb3.0_mex1.2/lbfgsb_wrapper.mexa64)

For me the problem was solved by running MATLAB with LD_PRELOAD and LD_LIBRARY_PATH, pointing to the system libraries:

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libgfortran.so.3 LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu matlab

Contact us