Class GradientDescent#

Inheritance Relationships#

Base Type#

Class Documentation#

class GradientDescent : public pele::ODEBasedOptimizer#

An implementation of the standard gradient descent optimization algorithm in c++.

The learning rate (step size) is set via initial_step. defaults to backtracking line search This optimizer can also be viewed as a Forward Euler Integrator with the backtracking line search as a time step controller. Hence this derives from ODEBasedOptimizer which allows for storing the trajectory as a function of the time in the ODE.

Public Functions

inline GradientDescent(
std::shared_ptr<pele::BasePotential> potential,
const pele::Array<double> x0,
double tol = 1e-4,
double step_size = 1e-4,
bool save_trajectory = true,
int iterations_before_save = 1,
bool use_hessian_step_size = false,
bool use_cosine_backtrack = false,
double cosine_backtrack_eps = 1e-2,
double cosine_backtrack_n = 5
)#

Constructor.

inline virtual ~GradientDescent()#

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