mlpack  master
Public Types | Public Member Functions | Private Attributes | List of all members
mlpack::optimization::AugLagrangian< LagrangianFunction > Class Template Reference

The AugLagrangian class implements the Augmented Lagrangian method of optimization. More...

Inheritance diagram for mlpack::optimization::AugLagrangian< LagrangianFunction >:
Inheritance graph
[legend]

Public Types

typedef L_BFGS< AugLagrangianFunction< LagrangianFunction > > L_BFGSType
 Shorthand for the type of the L-BFGS optimizer we'll be using. More...
 

Public Member Functions

 AugLagrangian (LagrangianFunction &function)
 Initialize the Augmented Lagrangian with the default L-BFGS optimizer. More...
 
 AugLagrangian (AugLagrangianFunction< LagrangianFunction > &augfunc, L_BFGSType &lbfgs)
 Initialize the Augmented Lagrangian with a custom L-BFGS optimizer. More...
 
const LagrangianFunction & Function () const
 Get the LagrangianFunction. More...
 
LagrangianFunction & Function ()
 Modify the LagrangianFunction. More...
 
const arma::vec & Lambda () const
 Get the Lagrange multipliers. More...
 
arma::vec & Lambda ()
 Modify the Lagrange multipliers (i.e. set them before optimization). More...
 
const L_BFGSTypeLBFGS () const
 Get the L-BFGS object used for the actual optimization. More...
 
L_BFGSTypeLBFGS ()
 Modify the L-BFGS object used for the actual optimization. More...
 
bool Optimize (arma::mat &coordinates, const size_t maxIterations=1000)
 Optimize the function. More...
 
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. More...
 
double Sigma () const
 Get the penalty parameter. More...
 
double & Sigma ()
 Modify the penalty parameter. More...
 

Private Attributes

AugLagrangianFunction< LagrangianFunction > augfunc
 Internally used AugLagrangianFunction which holds the function we are optimizing. More...
 
LagrangianFunction & function
 Function to be optimized. More...
 
L_BFGSTypelbfgs
 The L-BFGS optimizer that we will use. More...
 
L_BFGSType lbfgsInternal
 If the user did not pass an L_BFGS object, we'll use our own internal one. More...
 

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:

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
LagrangianFunctionFunction which can be optimized by this class.

Definition at line 49 of file aug_lagrangian.hpp.

Member Typedef Documentation

template<typename LagrangianFunction>
typedef L_BFGS<AugLagrangianFunction<LagrangianFunction> > mlpack::optimization::AugLagrangian< LagrangianFunction >::L_BFGSType

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

Definition at line 54 of file aug_lagrangian.hpp.

Constructor & Destructor Documentation

template<typename LagrangianFunction>
mlpack::optimization::AugLagrangian< LagrangianFunction >::AugLagrangian ( 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
functionThe function to be optimized.
template<typename LagrangianFunction>
mlpack::optimization::AugLagrangian< LagrangianFunction >::AugLagrangian ( AugLagrangianFunction< LagrangianFunction > &  augfunc,
L_BFGSType lbfgs 
)

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

Parameters
functionThe function to be optimized. This must be a pre-created utility AugLagrangianFunction.
lbfgsThe 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& mlpack::optimization::AugLagrangian< LagrangianFunction >::Function ( ) const
inline

Get the LagrangianFunction.

Definition at line 107 of file aug_lagrangian.hpp.

template<typename LagrangianFunction>
LagrangianFunction& mlpack::optimization::AugLagrangian< LagrangianFunction >::Function ( )
inline

Modify the LagrangianFunction.

Definition at line 109 of file aug_lagrangian.hpp.

template<typename LagrangianFunction>
const arma::vec& mlpack::optimization::AugLagrangian< LagrangianFunction >::Lambda ( ) const
inline

Get the Lagrange multipliers.

Definition at line 117 of file aug_lagrangian.hpp.

template<typename LagrangianFunction>
arma::vec& mlpack::optimization::AugLagrangian< LagrangianFunction >::Lambda ( )
inline

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

Definition at line 119 of file aug_lagrangian.hpp.

template<typename LagrangianFunction>
const L_BFGSType& mlpack::optimization::AugLagrangian< LagrangianFunction >::LBFGS ( ) const
inline

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

Definition at line 112 of file aug_lagrangian.hpp.

template<typename LagrangianFunction>
L_BFGSType& mlpack::optimization::AugLagrangian< LagrangianFunction >::LBFGS ( )
inline

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

Definition at line 114 of file aug_lagrangian.hpp.

template<typename LagrangianFunction>
bool mlpack::optimization::AugLagrangian< LagrangianFunction >::Optimize ( arma::mat &  coordinates,
const size_t  maxIterations = 1000 
)

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
coordinatesOutput matrix to store the optimized coordinates in.
maxIterationsMaximum number of iterations of the Augmented Lagrangian algorithm. 0 indicates no maximum.
sigmaInitial penalty parameter.
template<typename LagrangianFunction>
bool mlpack::optimization::AugLagrangian< LagrangianFunction >::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.

The vector of Lagrange multipliers will be modified to contain the Lagrange multipliers of the final solution (if one is found).

Parameters
coordinatesOutput matrix to store the optimized coordinates in.
initLambdaVector of initial Lagrange multipliers. Should have length equal to the number of constraints.
initSigmaInitial penalty parameter.
maxIterationsMaximum number of iterations of the Augmented Lagrangian algorithm. 0 indicates no maximum.
template<typename LagrangianFunction>
double mlpack::optimization::AugLagrangian< LagrangianFunction >::Sigma ( ) const
inline

Get the penalty parameter.

Definition at line 122 of file aug_lagrangian.hpp.

template<typename LagrangianFunction>
double& mlpack::optimization::AugLagrangian< LagrangianFunction >::Sigma ( )
inline

Modify the penalty parameter.

Definition at line 124 of file aug_lagrangian.hpp.

Member Data Documentation

template<typename LagrangianFunction>
AugLagrangianFunction<LagrangianFunction> mlpack::optimization::AugLagrangian< LagrangianFunction >::augfunc
private

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 133 of file aug_lagrangian.hpp.

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

template<typename LagrangianFunction>
LagrangianFunction& mlpack::optimization::AugLagrangian< LagrangianFunction >::function
private

Function to be optimized.

Definition at line 128 of file aug_lagrangian.hpp.

template<typename LagrangianFunction>
L_BFGSType& mlpack::optimization::AugLagrangian< LagrangianFunction >::lbfgs
private
template<typename LagrangianFunction>
L_BFGSType mlpack::optimization::AugLagrangian< LagrangianFunction >::lbfgsInternal
private

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

Definition at line 136 of file aug_lagrangian.hpp.


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