mlpack
a scalable c++ machine learning library
mlpack: mlpack::optimization::test::GeneralizedRosenbrockFunction Class Reference

# mlpack::optimization::test::GeneralizedRosenbrockFunction Class Reference

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...

List of all members.

## Public Member Functions

GeneralizedRosenbrockFunction (int n)
double Evaluate (const arma::mat &coordinates) const
double Evaluate (const arma::mat &coordinates, const size_t i) const
const arma::mat & GetInitialPoint () const
void Gradient (const arma::mat &coordinates, const size_t i, arma::mat &gradient) const
void Gradient (const arma::mat &coordinates, arma::mat &gradient) const
size_t NumFunctions () const

## Private Attributes

arma::mat initialPoint
int n

## Detailed Description

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().

"An analysis of the behavior of a glass of genetic adaptive systems." K.A. De Jong. Ph.D. thesis, University of Michigan, 1975.

Definition at line 123 of file test_functions.hpp.

## Constructor & Destructor Documentation

 mlpack::optimization::test::GeneralizedRosenbrockFunction::GeneralizedRosenbrockFunction ( int n )

## Member Function Documentation

 double mlpack::optimization::test::GeneralizedRosenbrockFunction::Evaluate ( const arma::mat & coordinates ) const
 double mlpack::optimization::test::GeneralizedRosenbrockFunction::Evaluate ( const arma::mat & coordinates, const size_t i ) const
 const arma::mat& mlpack::optimization::test::GeneralizedRosenbrockFunction::GetInitialPoint ( ) const
 void mlpack::optimization::test::GeneralizedRosenbrockFunction::Gradient ( const arma::mat & coordinates, arma::mat & gradient ) const
 void mlpack::optimization::test::GeneralizedRosenbrockFunction::Gradient ( const arma::mat & coordinates, const size_t i, arma::mat & gradient ) const
 size_t mlpack::optimization::test::GeneralizedRosenbrockFunction::NumFunctions ( ) const` [inline]`

Definition at line 136 of file test_functions.hpp.

## Member Data Documentation

 arma::mat mlpack::optimization::test::GeneralizedRosenbrockFunction::initialPoint` [private]`

Definition at line 145 of file test_functions.hpp.

 int mlpack::optimization::test::GeneralizedRosenbrockFunction::n` [private]`

Definition at line 146 of file test_functions.hpp.

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