mlpack  2.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
AugLagrangianFunction< LagrangianFunction > Class Template Reference

This is a utility class used by AugLagrangian, meant to wrap a LagrangianFunction into a function usable by a simple optimizer like L-BFGS. More...

Inheritance diagram for AugLagrangianFunction< LagrangianFunction >:
Inheritance graph
[legend]

Public Member Functions

 AugLagrangianFunction (LagrangianFunction &function)
 Initialize the AugLagrangianFunction, but don't set the Lagrange multipliers or penalty parameters yet. More...
 
 AugLagrangianFunction (LagrangianFunction &function, const arma::vec &lambda, const double sigma)
 Initialize the AugLagrangianFunction with the given LagrangianFunction, Lagrange multipliers, and initial penalty parameter. More...
 
double Evaluate (const arma::mat &coordinates) const
 Evaluate the objective function of the Augmented Lagrangian function, which is the standard Lagrangian function evaluation plus a penalty term, which penalizes unsatisfied constraints. More...
 
template<>
double Evaluate (const arma::mat &coordinates) const
 
template<>
double Evaluate (const arma::mat &coordinates) const
 
const LagrangianFunction & Function () const
 Get the Lagrangian function. More...
 
LagrangianFunction & Function ()
 Modify the Lagrangian function. More...
 
const arma::mat & GetInitialPoint () const
 Get the initial point of the optimization (supplied by the LagrangianFunction). More...
 
void Gradient (const arma::mat &coordinates, arma::mat &gradient) const
 Evaluate the gradient of the Augmented Lagrangian function. More...
 
template<>
void Gradient (const arma::mat &coordinates, arma::mat &gradient) const
 
template<>
void Gradient (const arma::mat &coordinates, arma::mat &gradient) const
 
const arma::vec & Lambda () const
 Get the Lagrange multipliers. More...
 
arma::vec & Lambda ()
 Modify the Lagrange multipliers. More...
 
double Sigma () const
 Get sigma (the penalty parameter). More...
 
double & Sigma ()
 Modify sigma (the penalty parameter). More...
 

Detailed Description

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

This is a utility class used by AugLagrangian, meant to wrap a LagrangianFunction into a function usable by a simple optimizer like L-BFGS.

Given a LagrangianFunction which follows the format outlined in the documentation for AugLagrangian, this class provides Evaluate(), Gradient(), and GetInitialPoint() functions which allow this class to be used with a simple optimizer like L-BFGS.

This class can be specialized for your particular implementation – commonly, a faster method for computing the overall objective and gradient of the augmented Lagrangian function can be implemented than the naive, default implementation given. Use class template specialization and re-implement all of the methods (unfortunately, C++ specialization rules mean you have to re-implement everything).

Template Parameters
LagrangianFunctionLagrangian function to be used.

Definition at line 38 of file aug_lagrangian_function.hpp.

Constructor & Destructor Documentation

AugLagrangianFunction ( LagrangianFunction &  function)

Initialize the AugLagrangianFunction, but don't set the Lagrange multipliers or penalty parameters yet.

Make sure you set the Lagrange multipliers before you use this...

Parameters
functionLagrangian function.
AugLagrangianFunction ( LagrangianFunction &  function,
const arma::vec &  lambda,
const double  sigma 
)

Initialize the AugLagrangianFunction with the given LagrangianFunction, Lagrange multipliers, and initial penalty parameter.

Parameters
functionLagrangian function.
lambdaInitial Lagrange multipliers.
sigmaInitial penalty parameter.

Member Function Documentation

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

Evaluate the objective function of the Augmented Lagrangian function, which is the standard Lagrangian function evaluation plus a penalty term, which penalizes unsatisfied constraints.

Parameters
coordinatesCoordinates to evaluate function at.
Returns
Objective function.
double Evaluate ( const arma::mat &  coordinates) const
inline
double Evaluate ( const arma::mat &  coordinates) const
inline
const LagrangianFunction& Function ( ) const
inline

Get the Lagrangian function.

Definition at line 98 of file aug_lagrangian_function.hpp.

LagrangianFunction& Function ( )
inline

Modify the Lagrangian function.

Definition at line 100 of file aug_lagrangian_function.hpp.

const arma::mat& GetInitialPoint ( ) const

Get the initial point of the optimization (supplied by the LagrangianFunction).

Returns
Initial point.
void Gradient ( const arma::mat &  coordinates,
arma::mat &  gradient 
) const

Evaluate the gradient of the Augmented Lagrangian function.

Parameters
coordinatesCoordinates to evaluate gradient at.
gradientMatrix to store gradient into.
void Gradient ( const arma::mat &  coordinates,
arma::mat &  gradient 
) const
inline
void Gradient ( const arma::mat &  coordinates,
arma::mat &  gradient 
) const
inline
const arma::vec& Lambda ( ) const
inline

Get the Lagrange multipliers.

Definition at line 88 of file aug_lagrangian_function.hpp.

arma::vec& Lambda ( )
inline

Modify the Lagrange multipliers.

Definition at line 90 of file aug_lagrangian_function.hpp.

double Sigma ( ) const
inline

Get sigma (the penalty parameter).

Definition at line 93 of file aug_lagrangian_function.hpp.

double& Sigma ( )
inline

Modify sigma (the penalty parameter).

Definition at line 95 of file aug_lagrangian_function.hpp.


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