[SciPy-User] Issue with SciPy opmize fmin_cg

The Helmbolds helmrp@yahoo....
Tue Jul 31 06:53:10 CDT 2012


I think you are right. I'm using a 64-bit machine with Windows operating system, but Python and SciPy are in my 32-bit programs folder.


>________________________________
>Message: 3
>Date: Sun, 29 Jul 2012 20:01:25 -0500
>From: Aronne Merrelli <aronne.merrelli@gmail.com>
>Subject: Re: [SciPy-User] Optimize fmin_cg issue
>To: SciPy Users List <scipy-user@scipy.org>
>I get the same result, but I get a very similar NaN result as the OP
>if I try with a point farther from zero (try [100,150] instead of
>[10,15]). That suggests this is a 32bit vs 64bit float overflow issue
>- perhaps OP is using 32 bit and we are using 64 bit floats. So, I
>doubt the algorithm has a bug per se, but the output message could be
>improved.
>
>I'm not an expert at this part of SciPy, but my guess is that the
>iteration loop just isn't checking for NaN values to determine the
>"success" of the iterative loop. Looking inside fmin_cg in optimize.py
>(moved to _minimize_cg() in the current github), I think what might be
>happening is that the gnorm variable is NaN, and then this causes the
>while loop to terminate since the while loop's conditional is (gnorm >
>gtol), and that will be false. So the later code just sees an exit of
>the while loop well short of the iteration maximum, and it only checks
>the iteration limit and step size (alpha_k) to determine "success".
>
>[1] https://github.com/scipy/scipy/blob/master/scipy/optimize/optimize.py
>
>Cheers,
>Aronne
>
>    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120731/1359485b/attachment-0001.html 


More information about the SciPy-User mailing list