[SciPy-dev] fmin_cg bug
Robert Cimrman
cimrman3 at ntc.zcu.cz
Mon Apr 24 07:43:03 CDT 2006
Hi,
the little script below revealed a little bug in scipy.optimize.fmin_cg:
before fix:
Warning: Desired error not necessarily achieved due to precision loss
Current function value: 333283335000.000000
Iterations: 0
Function evaluations: 2
Gradient evaluations: 1
after fix:
Optimization terminated successfully.
Current function value: 0.000000
Iterations: 5
Function evaluations: 26
Gradient evaluations: 26
I dared to commit the (little :) change to SVN.
r.
---
import numpy as nm
import scipy.optimize as opt
def f( x ):
return nm.sum( x * x )
def fg( x ):
return 2 * x
x0 = nm.arange( 100000, dtype = nm.float64 )
x = opt.fmin_cg( f, x0, fg )
More information about the Scipy-dev
mailing list