Skip to content
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

Add trust-radius quasi-Newton optimiser #262

Merged
merged 118 commits into from
Apr 13, 2023

Conversation

shoubhikraj
Copy link
Collaborator

@shoubhikraj shoubhikraj commented Mar 14, 2023

Major changes:

  • Adds a hybrid trust-radius model (TRM) and rational function (RFO) optimiser. When the RFO step is larger than the trust radius, it minimises the energy on a hypersphere of radius equal to trust radius (giving the best quadratic step within trust radius). If the minimisation fails, it falls back to scaling the RFO step
  • The trust radius is updated in every step, using modified Fletcher's method
  • The optimiser also has a damping feature which detects oscillations in energy and gradient, and interpolates between the last two coordinates to damp the oscillation.

Minor changes:

  • A draw_optimiser_plot() function is added so that optimiser convergence (energy and RMS gradient) with number of iterations can be plotted
  • Rename _OptimiserHistory to OptimiserHistory and subclass collections.UserList not list, so that list operations on OptimiserHistory returns instances of the same class and not list
  • The save_plot() function from autode.plotting now uses figure object of matplotlib instead of calling the implicit plt.savefig()
  • If the back-transform from delocalised internal coordinates to cartesian fails, RuntimeError is thrown if the flag to allow unconverged transform is set to False. This must be done at the end of step to ensure the new coordinates are converged. This fixes DIC iterated back-transform possible bug #257 .

Checklist

  • The changes include an associated explanation of how/why
  • Test pass
  • Documentation has been updated
  • Changelog has been updated
  • Change plotting for reaction profile to use axes and figure interface?

@shoubhikraj
Copy link
Collaborator Author

shoubhikraj commented Apr 6, 2023

@t-young31 Could you please leave the PR open? I planned to include polynomial line search but forgot about it, so I will have to add it. I will add it in a later PR.

Copy link
Member

@t-young31 t-young31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great to me 🚀
let me know when you'd like me to merge (or if you'd like that power!)

autode/opt/optimisers/hessian_update.py Outdated Show resolved Hide resolved
autode/opt/optimisers/crfo.py Outdated Show resolved Hide resolved
autode/opt/optimisers/base.py Show resolved Hide resolved
autode/opt/optimisers/base.py Outdated Show resolved Hide resolved
autode/opt/optimisers/trm.py Outdated Show resolved Hide resolved
@shoubhikraj
Copy link
Collaborator Author

@t-young31 I am finished with the changes. Please could you have a look and if you don't have anymore suggestions, feel free to merge this.

@t-young31 t-young31 merged commit fe54c19 into duartegroup:v1.4.0 Apr 13, 2023
@shoubhikraj shoubhikraj deleted the robust-optimiser branch April 17, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants