Rank: 402 based on 306 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 104 42
  • 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 157 14
  • 4.42857
4.4 | 7 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 18 0
29 Feb 2008 idctt type II Inverse DCT (i.e. type III DCT) Author: Stephen Becker spectral analysis, idct dct fft persiste... 10 0
26 Feb 2008 dctt type II DCT, improvement to matlab's dct Author: Stephen Becker spectral analysis, dct fft persistent sa... 14 0
Comments and Ratings by Stephen View all
Updated File Comments Rating
03 Jul 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

Hi Alexandre,
I've never seen that error either. Maybe ask the mathworks help about it.
-Stephen

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

Comments and Ratings on Stephen's Files View all
Updated File Comment by Comments Rating
22 Oct 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 Thomas,

Please download (it's free) the Dependency Walker 64 program and use it to analyze the mex file you created. Dependency Walker will tell you what dll's are missing and causing the "Attempt to access invalid address".
This problem can be solved if you are using Windows 7 64bit. In the case of Windows 8.1 I could not get it to work as the dylib libraries from the cygwin fortran make use of some dll's that are no longer available in Windows 8.1

Daniel

21 Oct 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 Humphries, Thomas

So I was happily using this code on my 32-bit workstation and now am enjoying trying to get it to work on my 64-bit laptop... I have followed Daniel's instructions below and have managed to get the .mexw64 file to compile, but when I try to run the example I get

Invalid MEX-file 'C:\Users\...\lbfgsb.3.0_1.2\lbfgsb_wrapper.mexw64': Attempt to access invalid address.

Error in lbfgsb (line 179)
[f, task, csave, lsave, isave, dsave] = ...

Error in example_NNLS (line 100)
[xk, ~, info] = lbfgsb(fun, l, u, opts );

Probably a longshot, but does anyone have any suggestion what could be causing this? I am guessing some kind of library linking issue but nothing comes up during the compilation process...

-TH

21 Oct 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 Lucas,

Sorry for my late reply, I haven't checked the posts in a while. I think the problem you describe is quite simple, namely you have to add in the PATH variable in Windows the path to the "lib" command from the Visual Studio folder.

13 Oct 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 Alexandre

I have received a couple of email asking me how to compile. Here how I proceeds in 2 steps on Linux (Mint 17 distro)

mex -v -c lbfgsb_wrapper.c -largeArrayDims -UDEBUG CFLAGS="\$CFLAGS -O3" ;

mex -v -output lbfgsb_wrapper lbfgsb_wrapper.o Lbfgsb.3.0/lbfgsb32.f Lbfgsb.3.0/linpack32.f Lbfgsb.3.0/timer.f FC="gfortran" -lm -lmwblascompat32 LINKEXPORT='Wl,--version-script,/usr/local/MATLAB/R2014a/extern/lib/glnxa64/mexFunction.map'

It is a colleague of mine who found out how to compile, therefore I am afraid I cannot explain why it works.

12 Oct 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 wenbin

I have the same problem as Alexandre. When I try to compile it under Linux with matlab R2014a, I get the following error:
Error using mex
Cannot compile both C and FORTRAN source files in a single call to MEX.

Error in compile_mex (line 61)
mex -v lbfgsb_wrapper.c -largeArrayDims -UDEBUG ...

Anyone had meet this problem? Please kindly show me the solution, I'm really in trouble.

Contact us