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

Guillaume Gay guillaume at damcb.com
Wed Nov 18 09:23:17 EST 2015


Hi,

Couldn't you store the associated data during the optimization, as part 
of the `fun` argument of minimize, which is a function?

Best,

Guilllaume


Le 18/11/2015 15:06, Mark vdw a écrit :
> Hi all,
>
> I want to keep track of the optimisation history when using minimize. 
> I want to keep track of the objective function value and the gradient. 
> However, the callback function is only given the current parameters, 
> not the actual value of the objective function and its gradient. So 
> whenever I want to store the current fval and gradient, I have to 
> recompute them in the callback, which is wasteful, especially in the 
> case where I want to store the values at every iteration.
>
> Is there a way to get the fval and gradient that have already been 
> computed inside the optimiser to the callback function?
>
> Many thanks,
> Mark
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> https://mail.scipy.org/mailman/listinfo/scipy-user

-- 

Guillaume Gay,
Data analysis and modeling in Comutational Biolgy

http://damcb.com

43 rue Horace Bertin
13005 Marseille

+33 953 55 98 89
+33 651 95 94 00

n°SIRET 751 175 233 00020

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20151118/752ad14c/attachment.html>


More information about the SciPy-User mailing list