[SciPy-User] optimize.fmin_cobyla giving nan to objective function

Gustavo Goretkin gustavo.goretkin@gmail....
Tue Aug 2 15:55:46 CDT 2011

>> Your function always returns inf, so it's not very surprising that you get
> a nan after a few iterations. Could happen for example if the code
> determines a derivative numerically, resulting in inf / inf = nan.
> It would be helpful if you had a realistic, self-contained example.
> Raln

In scikit-learn, fmin_cobyla is used to optimize some parameters of a
Gaussian Process. The objective function returns inf when the parameters are
such that the matrix calculations are unstable and NumPy throws a LinAlg
exception. What would be a better way to handle this?

My gut feeling is that an optimizer should not pass nan to the objective
function, since it cannot possibly be informative. Maybe checking for nan
would be inefficient.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20110802/9773f7fb/attachment.html 

More information about the SciPy-User mailing list