mlpack  3.0.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
aug_lagrangian.hpp
Go to the documentation of this file.
1 
15 #ifndef MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_HPP
16 #define MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_HPP
17 
18 #include <mlpack/prereqs.hpp>
20 
22 
23 namespace mlpack {
24 namespace optimization {
25 
47 {
48  public:
54  AugLagrangian();
55 
62  AugLagrangian(L_BFGS& lbfgs);
63 
76  template<typename LagrangianFunctionType>
77  bool Optimize(LagrangianFunctionType& function,
78  arma::mat& coordinates,
79  const size_t maxIterations = 1000);
80 
96  template<typename LagrangianFunctionType>
97  bool Optimize(LagrangianFunctionType& function,
98  arma::mat& coordinates,
99  const arma::vec& initLambda,
100  const double initSigma,
101  const size_t maxIterations = 1000);
102 
104  const L_BFGS& LBFGS() const { return lbfgs; }
106  L_BFGS& LBFGS() { return lbfgs; }
107 
109  const arma::vec& Lambda() const { return lambda; }
111  arma::vec& Lambda() { return lambda; }
112 
114  double Sigma() const { return sigma; }
116  double& Sigma() { return sigma; }
117 
118  private:
120  L_BFGS lbfgsInternal;
121 
123  L_BFGS& lbfgs;
124 
126  arma::vec lambda;
128  double sigma;
129 
134  template<typename LagrangianFunctionType>
136  arma::mat& coordinates,
137  const size_t maxIterations);
138 };
139 
140 } // namespace optimization
141 } // namespace mlpack
142 
143 #include "aug_lagrangian_impl.hpp"
144 
145 #endif // MLPACK_CORE_OPTIMIZERS_AUG_LAGRANGIAN_AUG_LAGRANGIAN_HPP
146 
double & Sigma()
Modify the penalty parameter.
The core includes that mlpack expects; standard C++ includes and Armadillo.
L_BFGS & LBFGS()
Modify the L-BFGS object used for the actual optimization.
const L_BFGS & LBFGS() const
Get the L-BFGS object used for the actual optimization.
double Sigma() const
Get the penalty parameter.
The AugLagrangian class implements the Augmented Lagrangian method of optimization.
AugLagrangian()
Initialize the Augmented Lagrangian with the default L-BFGS optimizer.
This is a utility class used by AugLagrangian, meant to wrap a LagrangianFunction into a function usa...
The generic L-BFGS optimizer, which uses a back-tracking line search algorithm to minimize a function...
Definition: lbfgs.hpp:35
arma::vec & Lambda()
Modify the Lagrange multipliers (i.e. set them before optimization).
const arma::vec & Lambda() const
Get the Lagrange multipliers.
bool Optimize(LagrangianFunctionType &function, arma::mat &coordinates, const size_t maxIterations=1000)
Optimize the function.