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... | |
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.
| SGDTestFunction | ( | ) |
Initialize the SGDTestFunction.
| double Evaluate | ( | const arma::mat & | coordinates, |
| const size_t | i | ||
| ) | const |
Evaluate a function.
Referenced by SGDTestFunction::GetInitialPoint().
| double Evaluate | ( | const arma::mat & | coordinates, |
| const size_t | begin, | ||
| const size_t | batchSize | ||
| ) | const |
Evaluate a function for a particular batch-size.
|
inline |
Get the starting point.
Definition at line 43 of file sgd_test_function.hpp.
References SGDTestFunction::Evaluate(), and SGDTestFunction::Gradient().
| void Gradient | ( | const arma::mat & | coordinates, |
| const size_t | i, | ||
| arma::mat & | gradient | ||
| ) | const |
Evaluate the gradient of a function.
Referenced by SGDTestFunction::GetInitialPoint().
| 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.
|
inline |
Return 3 (the number of functions).
Definition at line 40 of file sgd_test_function.hpp.
| void Shuffle | ( | ) |
Shuffle the order of function visitation.
This may be called by the optimizer.