Stan  2.10.0
probability, sampling & optimization
Public Types | Public Member Functions | Protected Attributes | List of all members
stan::optimization::LBFGSUpdate< Scalar, DimAtCompile > Class Template Reference

Implement a limited memory version of the BFGS update. More...

#include <lbfgs_update.hpp>

Public Types

typedef Eigen::Matrix< Scalar, DimAtCompile, 1 > VectorT
 
typedef Eigen::Matrix< Scalar, DimAtCompile, DimAtCompile > HessianT
 
typedef boost::tuple< Scalar, VectorT, VectorTUpdateT
 

Public Member Functions

 LBFGSUpdate (size_t L=5)
 
void set_history_size (size_t L)
 Set the number of inverse Hessian updates to keep. More...
 
Scalar update (const VectorT &yk, const VectorT &sk, bool reset=false)
 Add a new set of update vectors to the history. More...
 
void search_direction (VectorT &pk, const VectorT &gk) const
 Compute the search direction based on the current (inverse) Hessian approximation and given gradient. More...
 

Protected Attributes

boost::circular_buffer< UpdateT_buf
 
Scalar _gammak
 

Detailed Description

template<typename Scalar = double, int DimAtCompile = Eigen::Dynamic>
class stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >

Implement a limited memory version of the BFGS update.

This class maintains a circular buffer of inverse Hessian updates which can be applied to compute the search direction.

Definition at line 18 of file lbfgs_update.hpp.

Member Typedef Documentation

template<typename Scalar = double, int DimAtCompile = Eigen::Dynamic>
typedef Eigen::Matrix<Scalar, DimAtCompile, DimAtCompile> stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >::HessianT

Definition at line 21 of file lbfgs_update.hpp.

template<typename Scalar = double, int DimAtCompile = Eigen::Dynamic>
typedef boost::tuple<Scalar, VectorT, VectorT> stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >::UpdateT

Definition at line 23 of file lbfgs_update.hpp.

template<typename Scalar = double, int DimAtCompile = Eigen::Dynamic>
typedef Eigen::Matrix<Scalar, DimAtCompile, 1> stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >::VectorT

Definition at line 20 of file lbfgs_update.hpp.

Constructor & Destructor Documentation

template<typename Scalar = double, int DimAtCompile = Eigen::Dynamic>
stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >::LBFGSUpdate ( size_t  L = 5)
inlineexplicit

Definition at line 25 of file lbfgs_update.hpp.

Member Function Documentation

template<typename Scalar = double, int DimAtCompile = Eigen::Dynamic>
void stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >::search_direction ( VectorT pk,
const VectorT gk 
) const
inline

Compute the search direction based on the current (inverse) Hessian approximation and given gradient.

Parameters
[out]pkThe negative product of the inverse Hessian and gradient direction gk.
[in]gkGradient direction.

Definition at line 76 of file lbfgs_update.hpp.

template<typename Scalar = double, int DimAtCompile = Eigen::Dynamic>
void stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >::set_history_size ( size_t  L)
inline

Set the number of inverse Hessian updates to keep.

Parameters
LNew size of buffer.

Definition at line 32 of file lbfgs_update.hpp.

template<typename Scalar = double, int DimAtCompile = Eigen::Dynamic>
Scalar stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >::update ( const VectorT yk,
const VectorT sk,
bool  reset = false 
)
inline

Add a new set of update vectors to the history.

Parameters
ykDifference between the current and previous gradient vector.
skDifference between the current and previous state vector.
resetWhether to reset the approximation, forgetting about previous values.
Returns
In the case of a reset, returns the optimal scaling of the initial Hessian approximation which is useful for predicting step-sizes.

Definition at line 47 of file lbfgs_update.hpp.

Member Data Documentation

template<typename Scalar = double, int DimAtCompile = Eigen::Dynamic>
boost::circular_buffer<UpdateT> stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >::_buf
protected

Definition at line 112 of file lbfgs_update.hpp.

template<typename Scalar = double, int DimAtCompile = Eigen::Dynamic>
Scalar stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >::_gammak
protected

Definition at line 113 of file lbfgs_update.hpp.


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

     [ Stan Home Page ] © 2011–2016, Stan Development Team.