alpaqa 0.0.1
Nonconvex constrained optimization
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members

#include <alpaqa/inner/directions/decl/specialized-lbfgs.hpp>

Detailed Description

Limited memory Broyden–Fletcher–Goldfarb–Shanno (L-BFGS) algorithm that can handle updates of the γ parameter.

Definition at line 10 of file decl/specialized-lbfgs.hpp.

+ Collaboration diagram for SpecializedLBFGS:

Public Types

using Params = LBFGSParams
 

Public Member Functions

 SpecializedLBFGS (Params params)
 
 SpecializedLBFGS (Params params, size_t n, size_t history)
 
bool standard_update (crvec xₖ, crvec xₖ₊₁, crvec pₖ, crvec pₖ₊₁, crvec gradₖ₊₁)
 Standard L-BFGS update without changing the step size γ. More...
 
bool full_update (crvec xₖ, crvec xₖ₊₁, crvec pₖ_old_γ, crvec pₖ₊₁, crvec gradₖ₊₁, const Box &C, real_t γ)
 L-BFGS update when changing the step size γ, recomputing everything. More...
 
bool update (crvec xₖ, crvec xₖ₊₁, crvec pₖ, crvec pₖ₊₁, crvec gradₖ₊₁, const Box &C, real_t γ)
 Update the inverse Hessian approximation using the new vectors xₖ₊₁ and pₖ₊₁. More...
 
template<class Vec >
void apply (Vec &&q)
 Apply the inverse Hessian approximation to the given vector q. More...
 
void initialize (crvec x₀, crvec grad₀)
 Initialize with the starting point x₀ and the gradient in that point. More...
 
void reset ()
 Throw away the approximation and all previous vectors s and y. More...
 
void resize (size_t n, size_t history)
 Re-allocate storage for a problem with a different size. More...
 
std::string get_name () const
 
size_t n () const
 Get the size of the s, y, x and g vectors in the buffer. More...
 
size_t history () const
 Get the number of previous vectors s, y, x and g stored in the buffer. More...
 
size_t succ (size_t i) const
 Get the next index in the circular buffer of previous s, y, x and g vectors. More...
 
size_t pred (size_t i) const
 Get the previous index in the circular buffer of previous s, y, x and g vectors. More...
 
auto s (size_t i)
 
auto s (size_t i) const
 
auto y (size_t i)
 
auto y (size_t i) const
 
auto x (size_t i)
 
auto x (size_t i) const
 
auto g (size_t i)
 
auto g (size_t i) const
 
auto p ()
 
auto p () const
 
auto w ()
 
auto w () const
 
real_tρ (size_t i)
 
const real_tρ (size_t i) const
 
real_tα (size_t i)
 
const real_tα (size_t i) const
 

Private Types

using storage_t = Eigen::Matrix< real_t, Eigen::Dynamic, Eigen::Dynamic >
 

Private Attributes

storage_t sto
 
size_t idx = 0
 
bool full = false
 
real_t old_γ = 0
 
Params params
 

Member Typedef Documentation

◆ Params

Definition at line 12 of file decl/specialized-lbfgs.hpp.

◆ storage_t

using storage_t = Eigen::Matrix<real_t, Eigen::Dynamic, Eigen::Dynamic>
private

Definition at line 78 of file decl/specialized-lbfgs.hpp.

Constructor & Destructor Documentation

◆ SpecializedLBFGS() [1/2]

SpecializedLBFGS ( Params  params)
inline

Definition at line 14 of file decl/specialized-lbfgs.hpp.

◆ SpecializedLBFGS() [2/2]

SpecializedLBFGS ( Params  params,
size_t  n,
size_t  history 
)
inline

Definition at line 15 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ standard_update()

bool standard_update ( crvec  xₖ,
crvec  xₖ₊₁,
crvec  pₖ,
crvec  pₖ₊₁,
crvec  gradₖ₊₁ 
)
inline

Standard L-BFGS update without changing the step size γ.

Definition at line 19 of file specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ full_update()

bool full_update ( crvec  xₖ,
crvec  xₖ₊₁,
crvec  pₖ_old_γ,
crvec  pₖ₊₁,
crvec  gradₖ₊₁,
const Box C,
real_t  γ 
)
inline

L-BFGS update when changing the step size γ, recomputing everything.

Definition at line 50 of file specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

bool update ( crvec  xₖ,
crvec  xₖ₊₁,
crvec  pₖ,
crvec  pₖ₊₁,
crvec  gradₖ₊₁,
const Box C,
real_t  γ 
)
inline

Update the inverse Hessian approximation using the new vectors xₖ₊₁ and pₖ₊₁.

Definition at line 97 of file specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply()

void apply ( Vec &&  q)

Apply the inverse Hessian approximation to the given vector q.

Definition at line 109 of file specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize()

void initialize ( crvec  x₀,
crvec  grad₀ 
)
inline

Initialize with the starting point x₀ and the gradient in that point.

Definition at line 11 of file specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset()

void reset ( )
inline

Throw away the approximation and all previous vectors s and y.

Definition at line 142 of file specialized-lbfgs.hpp.

+ Here is the call graph for this function:

◆ resize()

void resize ( size_t  n,
size_t  history 
)
inline

Re-allocate storage for a problem with a different size.

Definition at line 135 of file specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_name()

std::string get_name ( ) const
inline

Definition at line 43 of file decl/specialized-lbfgs.hpp.

◆ n()

size_t n ( ) const
inline

Get the size of the s, y, x and g vectors in the buffer.

Definition at line 46 of file decl/specialized-lbfgs.hpp.

+ Here is the caller graph for this function:

◆ history()

size_t history ( ) const
inline

Get the number of previous vectors s, y, x and g stored in the buffer.

Definition at line 48 of file decl/specialized-lbfgs.hpp.

+ Here is the caller graph for this function:

◆ succ()

size_t succ ( size_t  i) const
inline

Get the next index in the circular buffer of previous s, y, x and g vectors.

Definition at line 51 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pred()

size_t pred ( size_t  i) const
inline

Get the previous index in the circular buffer of previous s, y, x and g vectors.

Definition at line 54 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ s() [1/2]

auto s ( size_t  i)
inline

Definition at line 56 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ s() [2/2]

auto s ( size_t  i) const
inline

Definition at line 57 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:

◆ y() [1/2]

auto y ( size_t  i)
inline

Definition at line 58 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ y() [2/2]

auto y ( size_t  i) const
inline

Definition at line 59 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ x() [1/2]

auto x ( size_t  i)
inline

Definition at line 60 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ x() [2/2]

auto x ( size_t  i) const
inline

Definition at line 61 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:

◆ g() [1/2]

auto g ( size_t  i)
inline

Definition at line 64 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ g() [2/2]

auto g ( size_t  i) const
inline

Definition at line 65 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ p() [1/2]

auto p ( )
inline

Definition at line 68 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ p() [2/2]

auto p ( ) const
inline

Definition at line 69 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:

◆ w() [1/2]

auto w ( )
inline

Definition at line 70 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ w() [2/2]

auto w ( ) const
inline

Definition at line 71 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:

◆ ρ() [1/2]

real_t & ρ ( size_t  i)
inline

Definition at line 72 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ρ() [2/2]

const real_t & ρ ( size_t  i) const
inline

Definition at line 73 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:

◆ α() [1/2]

real_t & α ( size_t  i)
inline

Definition at line 74 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ α() [2/2]

const real_t & α ( size_t  i) const
inline

Definition at line 75 of file decl/specialized-lbfgs.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ sto

storage_t sto
private

Definition at line 80 of file decl/specialized-lbfgs.hpp.

◆ idx

size_t idx = 0
private

Definition at line 81 of file decl/specialized-lbfgs.hpp.

◆ full

bool full = false
private

Definition at line 82 of file decl/specialized-lbfgs.hpp.

◆ old_γ

real_t old_γ = 0
private

Definition at line 83 of file decl/specialized-lbfgs.hpp.

◆ params

Params params
private

Definition at line 84 of file decl/specialized-lbfgs.hpp.


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