[SciPy-user] Optimizers and the number of iterations

Nils Wagner nwagner@iam.uni-stuttgart...
Wed Feb 28 08:25:46 CST 2007


Hi all,

AFAIK, only the number of function and gradient evaluations are directly
available via full_output=1.

Is there a better way to get the number of iterations ?

What I have used so far, is

x_opt, allvec=optimize.fmin_cg(func,x_0,retall=1)
print 'The number of iterations is',shape(allvec)[0]-1



Nils
 


More information about the SciPy-user mailing list