SYNOPSIS

Public Types

typedef L_BFGS

< AugLagrangianFunction

< LagrangianFunction > > L_BFGSType"

Shorthand for the type of the L-BFGS optimizer we'll be using.

Public Member Functions

AugLagrangian (LagrangianFunction &function)

Initialize the Augmented Lagrangian with the default L-BFGS optimizer. AugLagrangian (AugLagrangianFunction< LagrangianFunction > &augfunc, L_BFGSType &lbfgs)

Initialize the Augmented Lagrangian with a custom L-BFGS optimizer. const LagrangianFunction & Function () const

Get the LagrangianFunction. LagrangianFunction & Function ()

Modify the LagrangianFunction. const arma::vec & Lambda () const

Get the Lagrange multipliers. arma::vec & Lambda ()

Modify the Lagrange multipliers (i.e. set them before optimization). const L_BFGSType & LBFGS () const

Get the L-BFGS object used for the actual optimization. L_BFGSType & LBFGS ()

Modify the L-BFGS object used for the actual optimization. bool Optimize (arma::mat &coordinates, const size_t maxIterations=1000)

Optimize the function. bool Optimize (arma::mat &coordinates, const arma::vec &initLambda, const double initSigma, const size_t maxIterations=1000)

Optimize the function, giving initial estimates for the Lagrange multipliers. double Sigma () const

Get the penalty parameter. double & Sigma ()

Modify the penalty parameter. std::string ToString () const

Private Attributes

AugLagrangianFunction

< LagrangianFunction > augfunc"

Internally used AugLagrangianFunction which holds the function we are optimizing. LagrangianFunction & function

Function to be optimized. L_BFGSType & lbfgs

The L-BFGS optimizer that we will use. L_BFGSType lbfgsInternal

If the user did not pass an L_BFGS object, we'll use our own internal one.

Detailed Description

template<typename LagrangianFunction>class mlpack::optimization::AugLagrangian< LagrangianFunction >

The AugLagrangian class implements the Augmented Lagrangian method of optimization.

In this scheme, a penalty term is added to the Lagrangian. This method is also called the 'method of multipliers'.

The template class LagrangianFunction must implement the following five methods:

  • double Evaluate(const arma::mat& coordinates);

  • void Gradient(const arma::mat& coordinates, arma::mat& gradient);

  • size_t NumConstraints();

  • double EvaluateConstraint(size_t index, const arma::mat& coordinates);

  • double GradientConstraint(size_t index, const arma::mat& coordinates, arma::mat& gradient);

The number of constraints must be greater than or equal to 0, and EvaluateConstraint() should evaluate the constraint at the given index for the given coordinates. Evaluate() should provide the objective function value for the given coordinates.

Template Parameters:

LagrangianFunction Function which can be optimized by this class.

Definition at line 59 of file aug_lagrangian.hpp.

Member Typedef Documentation

template<typename LagrangianFunction> typedef \fBL_BFGS\fP<\fBAugLagrangianFunction\fP<LagrangianFunction> > \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::\fBL_BFGSType\fP

Shorthand for the type of the L-BFGS optimizer we'll be using.

Definition at line 64 of file aug_lagrangian.hpp.

Constructor & Destructor Documentation

template<typename LagrangianFunction> \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::\fBAugLagrangian\fP (LagrangianFunction &function)

Initialize the Augmented Lagrangian with the default L-BFGS optimizer. We limit the number of L-BFGS iterations to 1000, rather than the unlimited default L-BFGS.

Parameters:

function The function to be optimized.

template<typename LagrangianFunction> \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::\fBAugLagrangian\fP (\fBAugLagrangianFunction\fP< LagrangianFunction > &augfunc, \fBL_BFGSType\fP &lbfgs)

Initialize the Augmented Lagrangian with a custom L-BFGS optimizer.

Parameters:

function The function to be optimized. This must be a pre-created utility AugLagrangianFunction.

lbfgs The custom L-BFGS optimizer to be used. This should have already been initialized with the given AugLagrangianFunction.

Member Function Documentation

template<typename LagrangianFunction> const LagrangianFunction& \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::Function () const\fC [inline]\fP

Get the LagrangianFunction.

Definition at line 117 of file aug_lagrangian.hpp.

template<typename LagrangianFunction> LagrangianFunction& \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::Function ()\fC [inline]\fP

Modify the LagrangianFunction.

Definition at line 119 of file aug_lagrangian.hpp.

template<typename LagrangianFunction> const arma::vec& \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::Lambda () const\fC [inline]\fP

Get the Lagrange multipliers.

Definition at line 127 of file aug_lagrangian.hpp.

template<typename LagrangianFunction> arma::vec& \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::Lambda ()\fC [inline]\fP

Modify the Lagrange multipliers (i.e. set them before optimization).

Definition at line 129 of file aug_lagrangian.hpp.

template<typename LagrangianFunction> const \fBL_BFGSType\fP& \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::LBFGS () const\fC [inline]\fP

Get the L-BFGS object used for the actual optimization.

Definition at line 122 of file aug_lagrangian.hpp.

template<typename LagrangianFunction> \fBL_BFGSType\fP& \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::LBFGS ()\fC [inline]\fP

Modify the L-BFGS object used for the actual optimization.

Definition at line 124 of file aug_lagrangian.hpp.

template<typename LagrangianFunction> bool \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::Optimize (arma::mat &coordinates, const size_tmaxIterations = \fC1000\fP)

Optimize the function. The value '1' is used for the initial value of each Lagrange multiplier. To set the Lagrange multipliers yourself, use the other overload of Optimize().

Parameters:

coordinates Output matrix to store the optimized coordinates in.

maxIterations Maximum number of iterations of the Augmented Lagrangian algorithm. 0 indicates no maximum.

sigma Initial penalty parameter.

template<typename LagrangianFunction> bool \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::Optimize (arma::mat &coordinates, const arma::vec &initLambda, const doubleinitSigma, const size_tmaxIterations = \fC1000\fP)

Optimize the function, giving initial estimates for the Lagrange multipliers. The vector of Lagrange multipliers will be modified to contain the Lagrange multipliers of the final solution (if one is found).

Parameters:

coordinates Output matrix to store the optimized coordinates in.

initLambda Vector of initial Lagrange multipliers. Should have length equal to the number of constraints.

initSigma Initial penalty parameter.

maxIterations Maximum number of iterations of the Augmented Lagrangian algorithm. 0 indicates no maximum.

template<typename LagrangianFunction> double \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::Sigma () const\fC [inline]\fP

Get the penalty parameter.

Definition at line 132 of file aug_lagrangian.hpp.

template<typename LagrangianFunction> double& \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::Sigma ()\fC [inline]\fP

Modify the penalty parameter.

Definition at line 134 of file aug_lagrangian.hpp.

template<typename LagrangianFunction> std::string \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::ToString () const

Member Data Documentation

template<typename LagrangianFunction> \fBAugLagrangianFunction\fP<LagrangianFunction> \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::augfunc\fC [private]\fP

Internally used AugLagrangianFunction which holds the function we are optimizing. This isn't publically accessible, but we provide ways to get to the Lagrange multipliers and the penalty parameter sigma.

Definition at line 146 of file aug_lagrangian.hpp.

Referenced by mlpack::optimization::AugLagrangian< mlpack::optimization::LRSDPFunction >::Lambda(), and mlpack::optimization::AugLagrangian< mlpack::optimization::LRSDPFunction >::Sigma().

template<typename LagrangianFunction> LagrangianFunction& \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::function\fC [private]\fP

Function to be optimized.

Definition at line 141 of file aug_lagrangian.hpp.

template<typename LagrangianFunction> \fBL_BFGSType\fP& \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::lbfgs\fC [private]\fP

The L-BFGS optimizer that we will use.

Definition at line 152 of file aug_lagrangian.hpp.

Referenced by mlpack::optimization::AugLagrangian< mlpack::optimization::LRSDPFunction >::LBFGS().

template<typename LagrangianFunction> \fBL_BFGSType\fP \fBmlpack::optimization::AugLagrangian\fP< LagrangianFunction >::lbfgsInternal\fC [private]\fP

If the user did not pass an L_BFGS object, we'll use our own internal one.

Definition at line 149 of file aug_lagrangian.hpp.

Author

Generated automatically by Doxygen for MLPACK from the source code.