Coder Social home page Coder Social logo

Comments (12)

genmeblog avatar genmeblog commented on June 24, 2024

You can find #32 related. Try to comment out normalization step: #32 (comment)
In case you're using MoreThuente linesearch

from lbfgspp.

conradhuebler avatar conradhuebler commented on June 24, 2024

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:
https://gist.github.com/conradhuebler/445e6cd16c1f91230a9386c5abc320eb

from lbfgspp.

yixuan avatar yixuan commented on June 24, 2024

I'll take a look over the weekends.

from lbfgspp.

yixuan avatar yixuan commented on June 24, 2024

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.

from lbfgspp.

conradhuebler avatar conradhuebler commented on June 24, 2024

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.
However, in older versions of LBFGSpp, the numerically evaluated gradient did not make trouble.

from lbfgspp.

yixuan avatar yixuan commented on June 24, 2024

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.

from lbfgspp.

conradhuebler avatar conradhuebler commented on June 24, 2024

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.

from lbfgspp.

yixuan avatar yixuan commented on June 24, 2024

I have pushed a commit (6803e70) that realizes such an idea. Could you help test on your problems? Thanks.

from lbfgspp.

conradhuebler avatar conradhuebler commented on June 24, 2024

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 :-)

from lbfgspp.

yixuan avatar yixuan commented on June 24, 2024

Sure. Some minimal examples would be greatly appreciated.

from lbfgspp.

conradhuebler avatar conradhuebler commented on June 24, 2024

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:
The energy and gradients are obtained using the methods: UFF, GFNFF, and GFN2. They can be requested with
-method uff
-method gfnff
-method gfn2

-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.
So within that directory
~/yourpath/curcuma -opt input.xyz with LBFGS master and LBFGS (7e38486)
This should show the difference.
Thanks and good luck :-)

from lbfgspp.

conradhuebler avatar conradhuebler commented on June 24, 2024

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.

from lbfgspp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.