[SciPy-user] another optimization oddity

Travis Oliphant oliphant.travis at ieee.org
Fri Apr 5 12:04:26 EST 2002


On Fri, 2002-04-05 at 08:10, Steve M. Robbins wrote:
> On Fri, Apr 05, 2002 at 04:55:24PM +0200, Henk Jansen wrote:
> > As the owner of this prpblem I did some homework. I guess I've found a
> > bug in "scipy.minpack.leastsq.py" :
> 
> Speaking of odd things in scipy.optimize ...
> 
> I have a problem that is too large for the typical O(N^2) methods, so I
> implemented steepest descent and nonlinear conjugate gradient methods.
> 

Any chance you'd share these routines back?



> I wanted to use the function line_search() in optimize.py, but I am
> mystified by its use of the zoom() function:
> 
> 	def zoom(a_lo, a_hi):
> 	    pass
> 
> That looks like an uncompleted stub function to me.  Correct?

Yes indeed,

It looks like I never finished the line_search algorithm.  It's not used
in any of the other subroutins.  The BFGS algorithm uses the
line_search_BFGS algorithm which does pretty much the same thing.  

It's not documented, but it's pretty clear.   I suspect we should export
one of these line algorithms and make it part of the published
interface. 

line_search_BFGS(f, xk, pk, gfk, args=(), c1=1e-4,alpha0=1)

f -- the function
xk --  "reference vector"
pk -- minimization direction    Minimize f(xk+alpha*pk) over alpha

gfk -- vector giving the gradient of f at xk --- numbers not a function.

args --- extra arguments to the function.

c1 --- an accuracy constraint 

alpha0 --- starting guess for alpha


-Travis





More information about the SciPy-User mailing list