Menu

[r3313]: / trunk / py4science / book / examples / scipy / example5.4  Maximize  Restore  History

Download this file

12 lines (10 with data), 410 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
>>> from scipy.optimize import fmin_bfgs
>>> x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
>>> xopt = fmin_bfgs(rosen, x0, fprime=rosen_der)
Optimization terminated successfully.
Current function value: 0.000000
Iterations: 109
Function evaluations: 262
Gradient evaluations: 110
>>> print xopt
[ 1. 1. 1. 1. 1.]
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.