mlpack  git-master

IQN is a technique for minimizing a function which can be expressed as a sum of other functions. More...

Public Member Functions

 IQN (const double stepSize=0.01, const size_t batchSize=10, const size_t maxIterations=100000, const double tolerance=1e-5)
 Construct the IQN 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 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 IQN. 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...

 

Detailed Description

IQN is a technique for minimizing a function which can be expressed as a sum of other functions.

That is, suppose we have

\[ f(A) = \sum_{i = 0}^{n} f_i(A) \]

IQN is the first stochastic quasi- Newton method proven to converge superlinearly in a local neighborhood of the optimal solution.

For more information, please refer to:

@misc{1106.5730,
author = {Mokhtari, Aryan and Eisen, Mark and Ribeiro, Alejandro},
title = {IQN: An Incremental Quasi-Newton Method with Local Superlinear
Convergence Rate},
year = {2017},
eprint = {arXiv:1702.00709},
}

This class is useful for data-dependent functions whose objective function can be expressed as a sum of objective functions operating on an individual point. Then, IQN considers the gradient of the objective function operating on an individual point in its update of $ A $.

For IQN to work, the class must implement the following function:

size_t NumFunctions(); double Evaluate(const arma::mat& coordinates, const size_t i); void Gradient(const arma::mat& coordinates, const size_t i, arma::mat& gradient);

NumFunctions() should return the number of functions ( $n$), 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 (presumably, the dataset is held internally in the DecomposableFunctionType).

Definition at line 65 of file iqn.hpp.

Constructor & Destructor Documentation

◆ IQN()

IQN ( const double  stepSize = 0.01,
const size_t  batchSize = 10,
const size_t  maxIterations = 100000,
const double  tolerance = 1e-5 
)

Construct the IQN optimizer with the given function and parameters.

The defaults here are not necessarily good for the given problem, so it is suggested that the values used be tailored to the task at hand. The maximum number of iterations refers to the maximum number of points that are processed (i.e., one iteration equals one point; one iteration does not equal one pass over the dataset).

Parameters
stepSizeStep size for each iteration.
batchSizeSize of each batch.
maxIterationsMaximum number of iterations allowed (0 means no limit).
toleranceMaximum absolute tolerance to terminate algorithm.

Member Function Documentation

◆ BatchSize() [1/2]

size_t BatchSize ( ) const
inline

Get the batch size.

Definition at line 106 of file iqn.hpp.

◆ BatchSize() [2/2]

size_t& BatchSize ( )
inline

Modify the batch size.

Definition at line 108 of file iqn.hpp.

◆ MaxIterations() [1/2]

size_t MaxIterations ( ) const
inline

Get the maximum number of iterations (0 indicates no limit).

Definition at line 111 of file iqn.hpp.

◆ MaxIterations() [2/2]

size_t& MaxIterations ( )
inline

Modify the maximum number of iterations (0 indicates no limit).

Definition at line 113 of file iqn.hpp.

◆ Optimize()

double Optimize ( DecomposableFunctionType &  function,
arma::mat &  iterate 
)

Optimize the given function using IQN.

The given starting point will be modified to store the finishing point of the algorithm, and the final objective value is returned.

Template Parameters
DecomposableFunctionTypeType of the function to be optimized.
Parameters
functionFunction to optimize.
iterateStarting point (will be modified).
Returns
Objective value of the final point.

◆ StepSize() [1/2]

double StepSize ( ) const
inline

Get the step size.

Definition at line 101 of file iqn.hpp.

◆ StepSize() [2/2]

double& StepSize ( )
inline

Modify the step size.

Definition at line 103 of file iqn.hpp.

◆ Tolerance() [1/2]

double Tolerance ( ) const
inline

Get the tolerance for termination.

Definition at line 116 of file iqn.hpp.

◆ Tolerance() [2/2]

double& Tolerance ( )
inline

Modify the tolerance for termination.

Definition at line 118 of file iqn.hpp.


The documentation for this class was generated from the following file:
  • src/mlpack/core/optimizers/iqn/iqn.hpp