[SciPy-User] fmin_bfgs stuck in infinite loop

Pauli Virtanen pav@iki...
Tue Oct 25 04:46:02 CDT 2011


24.10.2011 19:50, Johann Cohen-Tanugi kirjoitti:
[clip]
>     while 1:
>         stp, phi1, derphi1, task = minpack2.dcsrch(alpha1, phi1, derphi1,
>                                                    c1, c2, xtol, task,
>                                                    amin, amax, isave, dsave)
>         if task[:2] == asbytes('FG') and not np.isnan(phi1):
>             alpha1 = stp
>             phi1 = phi(stp)
>             derphi1 = derphi(stp)
>         else:
>             break

Looks correct to me. It should bail out from the loop on encountering
a nan, as in that case it's unlikely it's possible to satisfy the wolfe
conditions.

-- 
Pauli Virtanen



More information about the SciPy-User mailing list