SGDTestFunction Class Reference

Very, very simple test function which is the composite of three other functions. More...

Public Member Functions

 SGDTestFunction ()
 Initialize the SGDTestFunction. More...

 
double Evaluate (const arma::mat &coordinates, const size_t i) const
 Evaluate a function. More...

 
double Evaluate (const arma::mat &coordinates, const size_t begin, const size_t batchSize) const
 Evaluate a function for a particular batch-size. More...

 
arma::mat GetInitialPoint () const
 Get the starting point. More...

 
void Gradient (const arma::mat &coordinates, const size_t i, arma::mat &gradient) const
 Evaluate the gradient of a function. More...

 
void Gradient (const arma::mat &coordinates, const size_t begin, arma::mat &gradient, const size_t batchSize) const
 Evaluate the gradient of a function for a particular batch-size. More...

 
size_t NumFunctions () const
 Return 3 (the number of functions). More...

 
void Shuffle ()
 Shuffle the order of function visitation. More...

 

Detailed Description

Very, very simple test function which is the composite of three other functions.

The gradient is not very steep far away from the optimum, so a larger step size may be required to optimize it in a reasonable number of iterations.

Definition at line 25 of file sgd_test_function.hpp.

Constructor & Destructor Documentation

◆ SGDTestFunction()

Initialize the SGDTestFunction.

Member Function Documentation

◆ Evaluate() [1/2]

double Evaluate ( const arma::mat &  coordinates,
const size_t  i 
) const

Evaluate a function.

Referenced by SGDTestFunction::GetInitialPoint().

◆ Evaluate() [2/2]

double Evaluate ( const arma::mat &  coordinates,
const size_t  begin,
const size_t  batchSize 
) const

Evaluate a function for a particular batch-size.

◆ GetInitialPoint()

arma::mat GetInitialPoint ( ) const
inline

Get the starting point.

Definition at line 43 of file sgd_test_function.hpp.

References SGDTestFunction::Evaluate(), and SGDTestFunction::Gradient().

◆ Gradient() [1/2]

void Gradient ( const arma::mat &  coordinates,
const size_t  i,
arma::mat &  gradient 
) const

Evaluate the gradient of a function.

Referenced by SGDTestFunction::GetInitialPoint().

◆ Gradient() [2/2]

void Gradient ( const arma::mat &  coordinates,
const size_t  begin,
arma::mat &  gradient,
const size_t  batchSize 
) const

Evaluate the gradient of a function for a particular batch-size.

◆ NumFunctions()

size_t NumFunctions ( ) const
inline

Return 3 (the number of functions).

Definition at line 40 of file sgd_test_function.hpp.

◆ Shuffle()

void Shuffle ( )

Shuffle the order of function visitation.

This may be called by the optimizer.


The documentation for this class was generated from the following file: