[SciPy-User] Access to objective function and gradient in minimize callback

Rob Clewley rob.clewley at gmail.com
Thu Nov 19 09:37:59 EST 2015


Hi Mark,

On Wed, Nov 18, 2015 at 9:06 AM, Mark vdw <markvanderw at gmail.com> wrote:
> Is there a way to get the fval and gradient that have already been computed
> inside the optimiser to the callback function?

You basically want a memoized version aka a cache. That's not too
tricky to write yourself but PyDSTool's optimization toolbox package
(mostly code donated by Matthieu Brucher) already does this nicely. It
also keeps a history of all the steps in case you need to do
diagnostics or backtrack.



More information about the SciPy-User mailing list