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

Ralf Gommers ralf.gommers@googlemail....
Tue Aug 2 15:42:25 CDT 2011


On Tue, Aug 2, 2011 at 9:53 PM, Gustavo Goretkin <gustavo.goretkin@gmail.com
> wrote:

> Okay here is a much simpler test case: https://gist.github.com/1121046
>
> The print statements, for me, show that *objective* is being passed nan.
> Does this warrant a ticket? Should I continue this discussion on the
> development list?
>
> 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.

Ralf

Gustavo
>
> On Mon, Aug 1, 2011 at 6:06 PM, Gustavo Goretkin <
> gustavo.goretkin@gmail.com> wrote:
>
>> The code depends on scikit-learn. I'll post the issue there if you think
>> the problem is related to that module. My thinking is that fmin_cobyla
>> shouldn't be feeding nan to the objective function.
>>
>> The code that causes the exception is gp_error.py . I made a change to one
>> of the functions in scikit-learn, so I just included that file too. Just
>> keep both files in the same directory.
>>
>> Thanks for the help.
>>
>> Gustavo
>>
>>
>>
>> On Mon, Aug 1, 2011 at 3:49 PM, Christopher Jordan-Squire <
>> cjordan1@uw.edu> wrote:
>>
>>> Could you send the code that's causing the problem?
>>>
>>> -Chris Jordan-Squire
>>>
>>> On Mon, Aug 1, 2011 at 2:23 PM, Gustavo Goretkin <
>>> gustavo.goretkin@gmail.com> wrote:
>>>
>>>> I am using the Gaussian Process module in scikit-learn. It uses
>>>> optimize.fmin_cobyla to find the best hyper-parameters. It looks like,
>>>> though, that fmin_cobyla is, after a couple of iterations, feeding nan to
>>>> the objective function. Any ideas?
>>>>
>>>> scipy.__version__ = '0.10.0.dev7180'
>>>>
>>>> Thanks,
>>>> Gustavo
>>>>
>>>> _______________________________________________
>>>> SciPy-User mailing list
>>>> SciPy-User@scipy.org
>>>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>>>
>>>>
>>>
>>> _______________________________________________
>>> SciPy-User mailing list
>>> SciPy-User@scipy.org
>>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>>
>>>
>>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20110802/ef1c01b4/attachment.html 


More information about the SciPy-User mailing list