0

I want to minimize some function J using gradient information. I found two functions in scipy that may do the job, scipy.optimize.fmin_tnc (here) and scipy.optimize.minimize (here), and I implemented them. However, now I need the stepwise output of the function evaluations at each step of the (e.g. Newton) algorithm to plot its convergence. Is it possible to get this vector somehow out of these functions? It is not part of default return values as it seems.

tomka
  • 2,516
  • 7
  • 31
  • 45
  • 1
    [related question](http://stackoverflow.com/questions/37042275/scipy-optimize-minimize-keep-track-of-objective-function) – Stelios Oct 27 '16 at 11:44
  • @Stelios Thanks -- the method presented there prints the function values but does not return them in an object. – tomka Oct 27 '16 at 11:50
  • 1
    You could initialize an empty list and append each generated value to it. – Stelios Oct 27 '16 at 12:05
  • I just figured exactly this out too. Perfect and simple answer. – tomka Oct 27 '16 at 12:06

0 Answers0