SyTen
gradient_opt.h File Reference

A collection of methods for gradient-based descent. More...

#include "inc/util/scalars.h"
+ Include dependency graph for gradient_opt.h:
+ This graph shows which files directly or indirectly include this file:

Namespaces

namespace  syten
 Syten namespace.
 
namespace  syten::GradientOpt
 Namespace for gradient-based optimisers.
 

Functions

template<typename Value , typename FunctionEval , typename GradientEval >
auto syten::GradientOpt::gradient_descent (Value x, FunctionEval func, GradientEval grad, SRDef step_size, Index num_steps)
 Straightforward gradient descent. More...
 
template<typename Value , typename FunctionEval , typename GradientEval , typename IsImprovement >
auto syten::GradientOpt::gradient_descent_adaptive_stepsize (Value x, FunctionEval func, GradientEval grad, IsImprovement improv, Index num_steps)
 Gradient descent with adaptive stepsize. More...
 
template<typename X , typename FunctionEval , typename GradientEval , typename LinesearchEval , typename RandomStep , typename Terminator >
auto syten::GradientOpt::gradient_descent_linesearch (X x, FunctionEval func, GradientEval grad, LinesearchEval lin, RandomStep rand, Terminator terminate, Index num_steps=100, Index ls_num_steps=50, SRDef ls_lower=0, SRDef ls_upper=1)
 Attempt at a gradient descent with linesearch. More...
 
template<typename Hp >
SRDef syten::GradientOpt::linesearch (Hp h_hp, SRDef lower, SRDef upper, Index const max_steps)
 Attempt at a bisecting line search. More...
 

Detailed Description

A collection of methods for gradient-based descent.

All of these methods assume that in order to evaluate the gradient, it is necessary to first evaluate the function value itself.

Remarks
All of these functions are largely untested and work very badly.