scipy.optimize.lbfgsb help please!!!

mclaugb mclaugb at nospm.yahoo.com
Sat Jan 20 11:07:43 EST 2007


Does anyone out there have a piece of code that demonstrates the use of the 
lbfgsb multivariate, bounded solver in the scipy.optimize toolkit?  An 
example would get me started because my code below does not seem to work.
Thanks alot,
Bryan


I have tried to use the LBFGSB optimisation algorithm with these parameters:

xstart = [20,-20]


x, f, d = lbfgsb.fmin_l_bfgs_b(Permmin, x0, Jacobi, params, 0, 
[(0,100),(0,-50)] , 10, 1e7, 1e-5, 1e-8, -1, 500)

I am getting this error:

 "   x, f, d = lbfgsb.fmin_l_bfgs_b(Permmin, x0, Jacobi, params, 0, 
[(.001,100),(-50,-.001)] , 10, 1e7, 1e-5, 1e-8, -1, 500)
  File "C:\Python24\lib\site-packages\scipy\optimize\lbfgsb.py", line 197, 
in fmin_l_bfgs_b
    isave, dsave)
ValueError: failed to initialize intent(inout) array -- expected elsize=8 
but got 4 -- input 'l' not compatible to 'd'
"

Permmin is a function that simply returns a vector array [xmin, ymin]

Jacobi returns an array [[A,B],[C,D]] which is the 2x2 Jacobi matrix

The rest of the parameters seem okay... 





More information about the Python-list mailing list