[SciPy-User] possible bug in scipy 0.10.1 newton_krylon solver
Mon Jun 18 13:36:50 CDT 2012
18.06.2012 14:03, Wu Degang kirjoitti:
> I'm using scipy on my macbook pro with mac os x lion through macports
> (py27-scipy). I'm not sure whether it is a platform-specific problem.
> Here is a program that should reproduces the bug:
Thanks for the report.
Based on the output, it looks like you are actually running the code as:
sol = newton_krylov(func,guess,line_search=False,verbose=1)
Note the value of the `line_search` parameter.
I see this only if the line search is disabled (regardless of Scipy
version), as above, although then the code wants to stick with a small
step size in the beginning and converges somewhat slowly.
The cause is probably that when line search is disabled, the strong
nonlinearity due to the exp functions causes the optimizer to get lost
in a "flat" region of the function. The finite-difference Jacobian
matrix estimate then likely is zero, which causes the Krylov solver to
spit out a zero vector (and an error code, which is ignored by the
When the solver reaches such a state, it cannot easily recover, hence
the failure. This may be a feature. I do not at the moment see useful
heuristics that would help here.
That it works differently on different machines is possibly that the
problem is sensitive to rounding error, which differs on different machines.
More information about the SciPy-User