I am using scipy.optimize.fmin
to optimize the Rosenbrock function:
import scipy
import bumpy as np
def rosen(x):
"""The Rosenbrock function"""
return sum(100.0*(x[1:]-x[:-1]**2.0)**2.0 + (1-x[:-1])**2.0)
x0 = np.array([1.3, 0.7, 0.8, 1.9, 1.2])
scipy.optimize.fmin(rosen, x0, full_output=True)
this returns a tuple for the solution (parameter that minimizes the function, the function minimum, number of iterations, number of function calls).
However I would like to be able to graph the values at each step. For example I would to plot the iteration number along the x-axis and the running minimum value along the y-axis.