17#ifndef GRADIENTDESCENT_H
18#define GRADIENTDESCENT_H
64 std::size_t
const size = 1);
75 std::size_t
const columns = 1);
105 std::string
status(std::size_t epoch)
const;
115 std::vector<std::string>
info()
const;
140 std::vector<double>
m;
142 std::vector<double>
v;
Weight updates based on simple gradient descent methods.
GradientDescent(std::size_t const sizeState, DescentType const type)
GradientDescent class constructor.
void setParametersFixed(double const eta)
Set parameters for fixed step gradient descent algorithm.
void setParametersAdam(double const eta, double const beta1, double const beta2, double const epsilon)
Set parameters for Adam algorithm.
std::string status(std::size_t epoch) const
Status report.
double epsilon
Small scalar.
DescentType
Enumerate different gradient descent variants.
@ DT_ADAM
Adaptive moment estimation (Adam).
@ DT_FIXED
Fixed step size.
std::vector< std::string > statusHeader() const
Header for status report file.
std::vector< double > v
Second moment estimate (Adam).
double beta2t
Decay rate 2 to the power of t (Adam).
double beta1t
Decay rate 1 to the power of t (Adam).
double eta0
Initial learning rate.
double eta
Learning rate .
double const * gradient
Gradient vector pointer.
double beta1
Decay rate 1 (Adam).
std::vector< double > m
First moment estimate (Adam).
void setJacobian(double const *const jacobian, std::size_t const columns=1)
Set pointer to current Jacobi matrix.
void setState(double *state)
Set pointer to current state.
virtual ~GradientDescent()
Destructor.
double beta2
Decay rate 2 (Adam).
double const * error
Error pointer (single double value).
std::vector< std::string > info() const
Information about gradient descent settings.
double * state
State vector pointer.
void setError(double const *const error, std::size_t const size=1)
Set pointer to current error vector.
void update()
Perform connection update.
Base class for different weight update methods.
std::size_t sizeState
Number of neural network connections (weights + biases).