-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hager-Zhang converges incorrectly within Optim.ConjugateGradient due to flatness check #175
Comments
See also #174 cc @mateuszbaran seems like it's another problem related to the flatness detection |
Thanks, this looks very similar, I will move the discussion there. |
It's not expected to be. Essentially all modern optimizers perform approximate line search. See, e.g., the Wolfe conditions. That said, returning |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found a case where the ConjugateGradient method of Optim.jl terminates early, at a non-stationary point, without raising an error. After some digging, the problem seems associated with LineSearches. I can't tell whether the actual bug is in in LineSearches, or in the way that Optim calls the Hager-Zhang line search. Your help in diagnosing this would be greatly appreciated.
Below is a simplified example illustrating how Hager-Zhang fails to converge correctly, given the (effective) parameters that are provided by Optim.jl:
The printed output of this code is:
Note that the final value
c=0.055...
is not a zero point of the derivativedϕ
.The HZ line search terminates early because this "flatness" condition is hit: https://github.com/JuliaNLSolvers/LineSearches.jl/blob/master/src/hagerzhang.jl#L282-L285
However, it's not clear to me whether the underlying problem is the HZ flatness condition, or the way that the call to
method.linesearch!
is made in Optim: https://github.com/JuliaNLSolvers/Optim.jl/blob/master/src/utilities/perform_linesearch.jl#L41-L60).Is it OK that the values of
phi_0, dphi_0
were calculated foralpha == 0
and notstate.alpha == 0.2
?To fix the bug, therefore, it seems that there are two possibilities:
method.linesearch!
, the values ofphi_0, dphi_0
should be recalculated for the newly guessedstate.alpha
.Thanks in advance.
The text was updated successfully, but these errors were encountered: