#include <quala/decl/lbfgs.hpp>
Limited memory Broyden–Fletcher–Goldfarb–Shanno (L-BFGS) algorithm.
Definition at line 72 of file decl/lbfgs.hpp.
|
| LBFGS (Params params) |
|
| LBFGS (Params params, length_t n) |
|
template<class VecS , class VecY > |
bool | update_sy (const anymat< VecS > &s, const anymat< VecY > &y, real_t pₙₑₓₜᵀpₙₑₓₜ, bool forced=false) |
| Update the inverse Hessian approximation using the new vectors sₖ = xₖ₊₁ - xₖ and yₖ = pₖ₊₁ - pₖ. More...
|
|
bool | update (crvec xₖ, crvec xₙₑₓₜ, crvec pₖ, crvec pₙₑₓₜ, Sign sign=Sign::Positive, bool forced=false) |
| Update the inverse Hessian approximation using the new vectors xₖ₊₁ and pₖ₊₁. More...
|
|
bool | apply (rvec q, real_t γ=-1) |
| Apply the inverse Hessian approximation to the given vector q. More...
|
|
template<class IndexVec > |
bool | apply (rvec q, real_t γ, const IndexVec &J) |
| Apply the inverse Hessian approximation to the given vector q, applying only the columns and rows of the Hessian in the index set J. More...
|
|
void | reset () |
| Throw away the approximation and all previous vectors s and y. More...
|
|
void | resize (length_t n) |
| Re-allocate storage for a problem with a different size. More...
|
|
void | scale_y (real_t factor) |
| Scale the stored y vectors by the given factor. More...
|
|
const Params & | get_params () const |
| Get the parameters. More...
|
|
length_t | n () const |
| Get the size of the s and y vectors in the buffer. More...
|
|
length_t | history () const |
| Get the number of previous vectors s and y stored in the buffer. More...
|
|
index_t | succ (index_t i) const |
| Get the next index in the circular buffer of previous s and y vectors. More...
|
|
index_t | pred (index_t i) const |
| Get the previous index in the circular buffer of s and y vectors. More...
|
|
length_t | current_history () const |
| Get the number of previous s and y vectors currently stored in the buffer. More...
|
|
auto | s (index_t i) |
|
auto | s (index_t i) const |
|
auto | y (index_t i) |
|
auto | y (index_t i) const |
|
real_t & | ρ (index_t i) |
|
const real_t & | ρ (index_t i) const |
|
real_t & | α (index_t i) |
|
const real_t & | α (index_t i) const |
|
template<class F > |
void | foreach_fwd (const F &fun) const |
| Iterate over the indices in the history buffer, oldest first. More...
|
|
template<class F > |
void | foreach_rev (const F &fun) const |
| Iterate over the indices in the history buffer, newest first. More...
|
|
◆ Params
◆ Sign
The sign of the vectors \( p \) passed to the LBFGS::update method.
Enumerator |
---|
Positive | \( p \sim \nabla \psi(x) \)
|
Negative | \( p \sim -\nabla \psi(x) \)
|
Definition at line 78 of file decl/lbfgs.hpp.
◆ LBFGS() [1/2]
◆ LBFGS() [2/2]
◆ update_valid()
Check if the new vectors s and y allow for a valid BFGS update that preserves the positive definiteness of the Hessian approximation.
Definition at line 9 of file lbfgs.hpp.
◆ update_sy()
bool update_sy |
( |
const anymat< VecS > & |
s, |
|
|
const anymat< VecY > & |
y, |
|
|
real_t |
pₙₑₓₜᵀpₙₑₓₜ, |
|
|
bool |
forced = false |
|
) |
| |
|
inline |
Update the inverse Hessian approximation using the new vectors sₖ = xₖ₊₁ - xₖ and yₖ = pₖ₊₁ - pₖ.
Definition at line 34 of file lbfgs.hpp.
◆ update()
Update the inverse Hessian approximation using the new vectors xₖ₊₁ and pₖ₊₁.
Definition at line 56 of file lbfgs.hpp.
◆ apply() [1/2]
Apply the inverse Hessian approximation to the given vector q.
Initial inverse Hessian approximation is set to \( H_0 = \gamma I \). If γ
is negative, \( H_0 = \frac{s^\top y}{y^\top y} I \).
Definition at line 64 of file lbfgs.hpp.
◆ apply() [2/2]
bool apply |
( |
rvec |
q, |
|
|
real_t |
γ, |
|
|
const IndexVec & |
J |
|
) |
| |
Apply the inverse Hessian approximation to the given vector q, applying only the columns and rows of the Hessian in the index set J.
Definition at line 93 of file lbfgs.hpp.
◆ reset()
Throw away the approximation and all previous vectors s and y.
Definition at line 180 of file lbfgs.hpp.
◆ resize()
Re-allocate storage for a problem with a different size.
Causes a reset.
Definition at line 185 of file lbfgs.hpp.
◆ scale_y()
Scale the stored y vectors by the given factor.
Definition at line 196 of file lbfgs.hpp.
◆ get_params()
const Params & get_params |
( |
| ) |
const |
|
inline |
◆ n()
Get the size of the s and y vectors in the buffer.
Definition at line 125 of file decl/lbfgs.hpp.
◆ history()
Get the number of previous vectors s and y stored in the buffer.
Definition at line 127 of file decl/lbfgs.hpp.
◆ succ()
Get the next index in the circular buffer of previous s and y vectors.
Definition at line 129 of file decl/lbfgs.hpp.
◆ pred()
Get the previous index in the circular buffer of s and y vectors.
Definition at line 131 of file decl/lbfgs.hpp.
◆ current_history()
Get the number of previous s and y vectors currently stored in the buffer.
Definition at line 134 of file decl/lbfgs.hpp.
◆ s() [1/2]
◆ s() [2/2]
◆ y() [1/2]
◆ y() [2/2]
◆ ρ() [1/2]
◆ ρ() [2/2]
◆ α() [1/2]
◆ α() [2/2]
◆ foreach_fwd()
void foreach_fwd |
( |
const F & |
fun | ) |
const |
|
inline |
Iterate over the indices in the history buffer, oldest first.
Definition at line 147 of file decl/lbfgs.hpp.
◆ foreach_rev()
void foreach_rev |
( |
const F & |
fun | ) |
const |
|
inline |
Iterate over the indices in the history buffer, newest first.
Definition at line 158 of file decl/lbfgs.hpp.
◆ sto
◆ idx
◆ full
◆ params
The documentation for this class was generated from the following files: