mlpack  master
Public Member Functions | List of all members
mlpack::optimization::test::SGDTestFunction Class Reference

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

Public Member Functions

 SGDTestFunction ()
 Nothing to do for the constructor. More...
 
double Evaluate (const arma::mat &coordinates, const size_t i) const
 Evaluate a function. 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...
 
size_t NumFunctions () const
 Return 3 (the number of functions). 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 test_function.hpp.

Constructor & Destructor Documentation

mlpack::optimization::test::SGDTestFunction::SGDTestFunction ( )
inline

Nothing to do for the constructor.

Definition at line 29 of file test_function.hpp.

Member Function Documentation

double mlpack::optimization::test::SGDTestFunction::Evaluate ( const arma::mat &  coordinates,
const size_t  i 
) const

Evaluate a function.

Referenced by GetInitialPoint().

arma::mat mlpack::optimization::test::SGDTestFunction::GetInitialPoint ( ) const
inline

Get the starting point.

Definition at line 35 of file test_function.hpp.

References Evaluate(), and Gradient().

void mlpack::optimization::test::SGDTestFunction::Gradient ( const arma::mat &  coordinates,
const size_t  i,
arma::mat &  gradient 
) const

Evaluate the gradient of a function.

Referenced by GetInitialPoint().

size_t mlpack::optimization::test::SGDTestFunction::NumFunctions ( ) const
inline

Return 3 (the number of functions).

Definition at line 32 of file test_function.hpp.


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