[SciPy-User] possible bug in scipy 0.10.1 newton_krylon solver

Pauli Virtanen pav at iki.fi
Mon Jun 18 14:36:50 EDT 2012



Hi,

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:
[clip]

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
Jacobian estimator).

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.

-- 
Pauli Virtanen




More information about the SciPy-User mailing list