-
Notifications
You must be signed in to change notification settings - Fork 104
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
Line Search failed using LBFGS for optimisation of chemical structures #33
Comments
You can find #32 related. Try to comment out normalization step: #32 (comment) |
Thanks for the comment. However, this does not really apply for my problem, as I am not using the box-constrained approach. Furthermore, it happens, depending on the 3D structure for several LineSearch methods. I have provided some samples and documentation: |
I'll take a look over the weekends. |
Since I am not super familiar with the library, I want to make sure one thing before I dive into the details. In your program, is the gradient computed analytically or numerically? Sometimes this is important since the line search can heavily rely on the accuracy of the gradient. |
Depending on the method to calculate the energy, the gradient is calculated either numerically or analytically. If no method is specified or '-method uff' is added, the gradient is still calculated numerically, but if the methods are gfn1 or gfn2 are used, the gradients are evaluated analytical. |
After some investigation I guess it is because in the old version, the line search silently exits if it reaches the maximum iteration (76ac83f), and in the new version it explicitly raises an exception. I would consider allowing some "failed" line searches in the new version. But still, an accurate computation of the gradient is invaluable in any case. |
Thanks for having a look at it. I am currently implementing the analytical gradients for the universal force field and with two terms out of five replaced, the optimisation is faster (of course) and much smoother. However, another method, which I just use via an interface and already is having analytical gradients, fails. So some kind "failed" lines searches sound great. |
I have pushed a commit (6803e70) that realizes such an idea. Could you help test on your problems? Thanks. |
Hi, I now have implemented the last part of the analytical gradient. I will compile some test cases in an extra branch. However, as far as I tested it already, your update does not really fix the issue, and it is more or less independent of the scheme to calculate the gradient. More will follow in the next days. Nevertheless, thanks for your time :-) |
Sure. Some minimal examples would be greatly appreciated. |
Hi, I have added some example structure files and some short explanation to https://github.com/conradhuebler/curcuma/tree/lbfgs/test_cases/optimisation in the branch https://github.com/conradhuebler/curcuma/tree/lbfgs. It might be a bit tricky to get started first but: -method uff is not necessary, as uff is the default one. There are numerical and analytical gradients for uff (-gradient 0 and -gradient 1). The gradients in gfnff und gfn2 are analytical. However, these methods are slower and come from third-party software. The first thing to start would be with the triose structure. |
Hi there, I have been playing around with the optimisation. I think, that for optimisation of chemical structure, throwing an exception if the linesearch fails etc is to harsh. The optimisation may proceed if this errors are just ignored for some steps. However, more digging is mandantory. I will adopt my fork to realise single step optimisation, where each of the termination condition can be handled individually and maybe some parameters can be altered during the optimsation. That is more (al)chemsitry than maths and if you are not interested in having this abilities in your library, than feel free to close this issue. |
Hey,
I am using this nice header-only LBFGS implementation to provide a geometry optimisation method in my molecular modelling program (https://github.com/conradhuebler/curcuma).
In order to have more control over the optimisation with respect to my quantities of interest, I made some changes to allow single steps during the minimisation and yesterday I merged the current upstream repo into my fork. However, now the line search and the optimisation fail.
As I merged the repos and need my personal changes, I can not track down the specific commit, which makes it fail.
So can I tweak some settings to recover the behaviour of the linesearch before:
commit 563106b
Author: Yixuan Qiu yixuanq@gmail.com
Date: Fri May 27 09:13:20 2022 +0800
?
The problem is, that either the numer of iterations in the line search is to low (thousends are not enough) or it might take to long for no positive outcome.
Is there something I could try?
Thanks and thanks for making LBFGSpp,
Conrad
The text was updated successfully, but these errors were encountered: