Optimizers.gradient_descent module

Description

This module defines the ParaMol.Optimizers.gradient_descent.GradientDescent class, which is the ParaMol implementation of the gradient descent method.

class ParaMol.Optimizers.gradient_descent.GradientDescent(max_iter, derivative_calculation, derivative_type, g_tol, f_tol, dx, derivative_h)

Bases: object

ParaMol implementation of the gradient descent optimizer.

Parameters
  • max_iter (float) – Maximum number of iterations.

  • derivative_calculation (str) – When to calculate the derivatives, which are the most computational expensive part of the algorithm. A fair approximation is to re-compute the derivative only if the value of the objective function has increased in successive iterations. Available options are “f-increase” and “always”.

  • derivative_type (str) – Type of numerical differentiation to perform. Available options are “1-point” or “2-point”.

  • g_tol (float) – Threshold that defines when the gradient is deemed to be converged, i.e., if the change in the gradient is lower than this threshold than we assume convergence has been reached.

  • f_tol (float) – Threshold that defines when the objective function is deemed to be converged, i.e., if the change in the objective function is lower than this threshold than we assume convergence has been reached.

  • dx (float) – Change in x for the numerical differentiation (denominator).

  • derivative_h (float) – Scaling factor that multiplies the step size of the descent.

run_optimization(f, parameters, constraints=None)

Method that performs optimization using the gradient descent method.

Notes

When the number of conformations being used in the optimization is large (>= 1000) it becomes prohibitive to numerically calculate the derivatives every iteration due to the requirement of calculating the objective function. A fair approximation for this situations is to re-compute the derivative only if the value of the objective function has increased in successive iterations.

Source: ‘Developing Consistent Molecular Dynamics Force Fields for Biological Chromophores via Force Matching’ K. Claridge and Troisi A. J. Phys. Chem. B 2019, 123, 2, 428–438

Parameters
  • f (callable) – Reference of the objective function.

  • parameters (list) – 1D list with the adimensional mathematical parameters that will be used in the optimization.

  • constraints (None) – Should be None. Monte Carlo optimizer cannot handle restraints.

Returns

parameters – 1D list with the updated adimensional mathematical parameters.