-
Notifications
You must be signed in to change notification settings - Fork 100
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
More Thuente line search can find proper step #32
Comments
As I understand More & Thuente paper, initial conditions (dg<0, continuous funcition) guarantess finding optimal step which is not the case in the example above. I'll read dig details soon but maybe you can figure out what is going on here earlier. |
Discovered, that R version shows details. Looks like after first iteration line search in R makes bigger step:
while when using LBFGSpp (after 8 iterations)
|
Ok, I found the difference, original L-BFGS-B doesnt normalize Turning off normalization, I'm getting more accuarate and comparable results to the R |
Yes, this is a known difference. Thanks for pointing out. |
Yes, this is a known difference. Thanks for pointing out. |
Thanks! I hit quite often minimal step issue which is not the case for a version from original L-BFGS-B. So maybe something happens inside your version of line search. |
After more experiments I observe that limiting first step (by normalizing) causes more test functions to wrong convergence. I found that changing to weak Wolfe test helps in certain scenarios, it definitely makes steps shorter (resulting in slower convergence). Weak Wolfe helps also when function is not smooth. |
OK, so I finally figured out the problem -- The gradient computation is wrong. 😂 The second partial derivative should be grad [1] = 4*x2 + 0.3* std::sin (3.0*PI*x1 + 4.0*PI*x2)*4.0*PI; |
Ooops... What a stupid mistake... sorry for that. I'll let you know if I find the other case (I'm pretty sure there was another, I hope with proper gradient :) ). |
Let me close this first, and feel free to reopen if further issues occur. |
Hi!
I've ported your fantastic library (L-BFGS-B only) to Java and starting to test against different cases. TBH, let's say, I understand most of the concepts but most of the stuff I copy&pasted without deeper understanding. Anyway, while testing my port and your library against number of targets - the results are consistent (successes and fails).
The case I work on now is the Bohachevsky 3 function .
lb
is[-100,-100]
,ub
is[100,100]
and initialx
is[-100,-100]
.Line search algorithm fails to find proper step during sixth iteration (
k=6
) forx=[-1.17596, -1.02192]
,grad=[0.291111,0.61104]
anddrt=[-0.0207124, -0.0218626]
.The step is getting lower and lower to reach either minimum step size or maximum number of iterations.
My investigation shows that at the beginning of line search, first wolfe condition is false, second is true, later second condition starts to be false, and much later first starts to be true, below is the debug from my java code (similar result is in your code).
So either More-Thuente search does something wrong, or Cauchy point is wrong, or something different. I can't figure it out unfortunately.
R
optim
works well for this case.The text was updated successfully, but these errors were encountered: