---
name: "mlpack_optimization_test_SGDTestFunction"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_optimization_test_SGDTestFunction"
---

# mlpack\_optimization\_test\_SGDTestFunction(3)

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

## NAME

mlpack::optimization::test::SGDTestFunction -

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

## SYNOPSIS

### Public Member Functions

**SGDTestFunction** ()\
 *Nothing to do for the constructor.*  double **Evaluate** (const arma::mat &coordinates, const size\_t i) const \
 *Evaluate a function.*  arma::mat **GetInitialPoint** () const \
 *Get the starting point.*  void **Gradient** (const arma::mat &coordinates, const size\_t i, arma::mat &gradient) const \
 *Evaluate the gradient of a function.*  size\_t **NumFunctions** () const \
 *Return 3 (the number of functions).*

## Detailed Description

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

It turns out that although this function is very simple, optimizing it fully can take a very long time. It seems to take in excess of 10 million iterations with a step size of 0.0005.

Definition at line 35 of file test\_function.hpp.

## Constructor & Destructor Documentation

### mlpack::optimization::test::SGDTestFunction::SGDTestFunction ()` [inline]`

Nothing to do for the constructor.

Definition at line 39 of file test\_function.hpp.

## Member Function Documentation

### double mlpack::optimization::test::SGDTestFunction::Evaluate (const arma::mat &coordinates, const size\_ti) const

Evaluate a function.

### arma::mat mlpack::optimization::test::SGDTestFunction::GetInitialPoint () const` [inline]`

Get the starting point.

Definition at line 45 of file test\_function.hpp.

### void mlpack::optimization::test::SGDTestFunction::Gradient (const arma::mat &coordinates, const size\_ti, arma::mat &gradient) const

Evaluate the gradient of a function.

### size\_t mlpack::optimization::test::SGDTestFunction::NumFunctions () const` [inline]`

Return 3 (the number of functions).

Definition at line 42 of file test\_function.hpp.

## Author

Generated automatically by Doxygen for MLPACK from the source code.
