scipy.optimize.fmin_bfgs not handling functions with boundaries that go infinite or very large correctly (Trac #1644) #2169
Labels
defect
A clear bug or issue that prevents SciPy from being installed or used as expected
good first issue
Good topic for first contributor pull requests, with a relatively straightforward solution
Migrated from Trac
scipy.optimize
Milestone
Original ticket http://projects.scipy.org/scipy/ticket/1644 on 2012-04-17 by trac user jsalvatier, assigned to unknown.
Here's the toy problem I've set up:
The solver returns [nan] as the solution.
The problem is designed to be stiff: between 0 and 1, it slopes upward to infinity but between 1 and infinity, it slopes up at a slope of 1. Left of 0 the function has a "nearly infinite" value. If bfgs encounters a value that's larger than the current value, it should try a different step size, no?
See this thread: http://mail.scipy.org/pipermail/scipy-user/2012-April/032088.html
It seems that what was actually happening is that in line_search_wolfe2, calling scalar_search_wolfe2 calling _zoom calling _cubicmin was returning a NaN if you add a test at the end of _cubicmin testing for a NaN (and then returning None), it finds the right minimum. It looks like _quadmin probably would have the same problem.
The text was updated successfully, but these errors were encountered: