The Generalized Rosenbrock function in n dimensions, defined by f(x) = sum_i^{n - 1} (f(i)(x)) f_i(x) = 100 * (x_i^2 - x_{i + 1})^2 + (1 - x_i)^2 x_0 = [-1.2, 1, -1.2, 1, ...]. More...
Public Member Functions | |
| GeneralizedRosenbrockFunction (const size_t n) | |
| double | Evaluate (const arma::mat &coordinates, const size_t begin, const size_t batchSize=1) const |
| double | Evaluate (const arma::mat &coordinates) const |
| const arma::mat & | GetInitialPoint () const |
| Get the starting point. More... | |
| void | Gradient (const arma::mat &coordinates, const size_t begin, arma::mat &gradient, const size_t batchSize=1) const |
| void | Gradient (const arma::mat &coordinates, const size_t begin, arma::sp_mat &gradient, const size_t count) const |
| void | Gradient (const arma::mat &coordinates, arma::mat &gradient) const |
| size_t | NumFunctions () const |
| Return 1 (the number of functions). More... | |
| void | Shuffle () |
| Shuffle the order of function visitation. More... | |
The Generalized Rosenbrock function in n dimensions, defined by f(x) = sum_i^{n - 1} (f(i)(x)) f_i(x) = 100 * (x_i^2 - x_{i + 1})^2 + (1 - x_i)^2 x_0 = [-1.2, 1, -1.2, 1, ...].
This should optimize to f(x) = 0, at x = [1, 1, 1, 1, ...].
This function can also be used for stochastic gradient descent (SGD) as a decomposable function (DecomposableFunctionType), so there are other overloads of Evaluate() and Gradient() implemented, as well as NumFunctions().
For more information, please refer to:
Definition at line 48 of file generalized_rosenbrock_function.hpp.
| GeneralizedRosenbrockFunction | ( | const size_t | n | ) |
| double Evaluate | ( | const arma::mat & | coordinates, |
| const size_t | begin, | ||
| const size_t | batchSize = 1 |
||
| ) | const |
Referenced by GeneralizedRosenbrockFunction::GetInitialPoint().
| double Evaluate | ( | const arma::mat & | coordinates | ) | const |
|
inline |
Get the starting point.
Definition at line 68 of file generalized_rosenbrock_function.hpp.
References GeneralizedRosenbrockFunction::Evaluate(), and GeneralizedRosenbrockFunction::Gradient().
| void Gradient | ( | const arma::mat & | coordinates, |
| const size_t | begin, | ||
| arma::mat & | gradient, | ||
| const size_t | batchSize = 1 |
||
| ) | const |
Referenced by GeneralizedRosenbrockFunction::GetInitialPoint().
| void Gradient | ( | const arma::mat & | coordinates, |
| const size_t | begin, | ||
| arma::sp_mat & | gradient, | ||
| const size_t | count | ||
| ) | const |
| void Gradient | ( | const arma::mat & | coordinates, |
| arma::mat & | gradient | ||
| ) | const |
|
inline |
Return 1 (the number of functions).
Definition at line 65 of file generalized_rosenbrock_function.hpp.
| void Shuffle | ( | ) |
Shuffle the order of function visitation.
This may be called by the optimizer.