Class CosineGradientDescent#

Inheritance Relationships#

Base Type#

Class Documentation#

class CosineGradientDescent : public pele::ODEBasedOptimizer#

An implementation of the standard gradient descent optimization algorithm with a step size adaptation based on the cosine similarity between successive gradients.

This is described in https://journals.aps.org/pre/pdf/10.1103/PhysRevE.108.054102. In practice, you may be better off using the standard gradient descent implementation in gradient_descent.cpp for optimization or CVODE if you’re interested in inherent structures. This diverges from the description in the sense that instead of using the initial stepsize based on the largest unbalanced force, init step size is set outside. This implementation was written purely for comparison purposes.

Public Functions

inline CosineGradientDescent(
std::shared_ptr<pele::BasePotential> potential,
const pele::Array<double> x0,
double tol = 1e-4,
double cos_sim_tol = 1e-2,
double dt_initial = 1e-5,
int back_track_n = 5,
bool save_trajectory = true,
int iterations_before_save = 1
)#

Constructor.

inline virtual ~CosineGradientDescent()#

Destructor.

inline virtual void one_iteration()#

Do one iteration iteration of the optimization algorithm.

inline virtual void reset(pele::Array<double> &x0)#

reset the optimizer to start a new minimization from x0