mlpack  git-master
AugLagrangian Class Reference

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

Public Member Functions

 AugLagrangian ()
 Initialize the Augmented Lagrangian with the default L-BFGS optimizer. More...

 
 AugLagrangian (L_BFGS &lbfgs)
 Initialize the Augmented Lagrangian with a custom L-BFGS optimizer. 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_BFGSLBFGS () const
 Get the L-BFGS object used for the actual optimization. More...

 
L_BFGSLBFGS ()
 Modify the L-BFGS object used for the actual optimization. More...

 
template
<
typename
LagrangianFunctionType
>
bool Optimize (LagrangianFunctionType &function, arma::mat &coordinates, const size_t maxIterations=1000)
 Optimize the function. More...

 
template
<
typename
LagrangianFunctionType
>
bool Optimize (LagrangianFunctionType &function, 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...

 

Detailed Description

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 LagrangianFunctionType, used by the Optimize() method, 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.

Definition at line 46 of file aug_lagrangian.hpp.

Constructor & Destructor Documentation

◆ AugLagrangian() [1/2]

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.

◆ AugLagrangian() [2/2]

AugLagrangian ( L_BFGS lbfgs)

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

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

Member Function Documentation

◆ Lambda() [1/2]

const arma::vec& Lambda ( ) const
inline

Get the Lagrange multipliers.

Definition at line 109 of file aug_lagrangian.hpp.

◆ Lambda() [2/2]

arma::vec& Lambda ( )
inline

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

Definition at line 111 of file aug_lagrangian.hpp.

◆ LBFGS() [1/2]

const L_BFGS& LBFGS ( ) const
inline

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

Definition at line 104 of file aug_lagrangian.hpp.

◆ LBFGS() [2/2]

L_BFGS& LBFGS ( )
inline

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

Definition at line 106 of file aug_lagrangian.hpp.

◆ Optimize() [1/2]

bool Optimize ( LagrangianFunctionType &  function,
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().

Template Parameters
LagrangianFunctionTypeFunction which can be optimized by this class.
Parameters
functionThe function to optimize.
coordinatesOutput matrix to store the optimized coordinates in.
maxIterationsMaximum number of iterations of the Augmented Lagrangian algorithm. 0 indicates no maximum.

Referenced by AugLagrangian::Sigma().

◆ Optimize() [2/2]

bool Optimize ( LagrangianFunctionType &  function,
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).

Template Parameters
LagrangianFunctionTypeFunction which can be optimized by this class.
Parameters
functionThe function to optimize.
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.

◆ Sigma() [1/2]

double Sigma ( ) const
inline

Get the penalty parameter.

Definition at line 114 of file aug_lagrangian.hpp.

◆ Sigma() [2/2]

double& Sigma ( )
inline

Modify the penalty parameter.

Definition at line 116 of file aug_lagrangian.hpp.

References AugLagrangian::Optimize().


The documentation for this class was generated from the following file:
  • /var/www/www.mlpack.org/mlpack-git/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian.hpp