|
| | SARAHType (const double stepSize=0.01, const size_t batchSize=32, const size_t maxIterations=1000, const size_t innerIterations=0, const double tolerance=1e-5, const bool shuffle=true, const UpdatePolicyType &updatePolicy=UpdatePolicyType()) |
| | Construct the SARAH optimizer with the given function and parameters. More...
|
| |
| size_t | BatchSize () const |
| | Get the batch size. More...
|
| |
| size_t & | BatchSize () |
| | Modify the batch size. More...
|
| |
| size_t | InnerIterations () const |
| | Get the maximum number of iterations (0 indicates default n / b). More...
|
| |
| size_t & | InnerIterations () |
| | Modify the maximum number of iterations (0 indicates default n / b). More...
|
| |
| size_t | MaxIterations () const |
| | Get the maximum number of iterations (0 indicates no limit). More...
|
| |
| size_t & | MaxIterations () |
| | Modify the maximum number of iterations (0 indicates no limit). More...
|
| |
template < typename DecomposableFunctionType > |
| double | Optimize (DecomposableFunctionType &function, arma::mat &iterate) |
| | Optimize the given function using SARAH. More...
|
| |
| bool | Shuffle () const |
| | Get whether or not the individual functions are shuffled. More...
|
| |
| bool & | Shuffle () |
| | Modify whether or not the individual functions are shuffled. More...
|
| |
| double | StepSize () const |
| | Get the step size. More...
|
| |
| double & | StepSize () |
| | Modify the step size. More...
|
| |
| double | Tolerance () const |
| | Get the tolerance for termination. More...
|
| |
| double & | Tolerance () |
| | Modify the tolerance for termination. More...
|
| |
| const UpdatePolicyType & | UpdatePolicy () const |
| | Get the update policy. More...
|
| |
| UpdatePolicyType & | UpdatePolicy () |
| | Modify the update policy. More...
|
| |
template
<
typename
UpdatePolicyType
>
class mlpack::optimization::SARAHType< UpdatePolicyType >
StochAstic Recusive gRadient algoritHm (SARAH).
is a variance reducing stochastic recursive gradient algorithm for minimizing a function which can be expressed as a sum of other functions.
For more information, see the following.
@article{Nguyen2017,
author = {{Nguyen}, L.~M. and {Liu}, J. and {Scheinberg},
K. and {Tak{\'a}{\v c}}, M.},
title = {SARAH: A Novel Method for Machine Learning Problems Using
Stochastic Recursive Gradient},
journal = {ArXiv e-prints},
url = {https://arxiv.org/abs/1703.00102}
year = 2017,
}
For SARAH to work, a DecomposableFunctionType template parameter is required. This class must implement the following function:
size_t NumFunctions(); double Evaluate(const arma::mat& coordinates, const size_t i, const size_t batchSize); void Gradient(const arma::mat& coordinates, const size_t i, arma::mat& gradient, const size_t batchSize);
NumFunctions() should return the number of functions (
), and in the other two functions, the parameter i refers to which individual function (or gradient) is being evaluated. So, for the case of a data-dependent function, such as NCA (see mlpack::nca::NCA), NumFunctions() should return the number of points in the dataset, and Evaluate(coordinates, 0) will evaluate the objective function on the first point in the dataset ( is held internally in the DecomposableFunctionType).
- Template Parameters
-
| UpdatePolicyType | update policy used by SARAHType during the iterative update process. |
Definition at line 66 of file sarah.hpp.