![]() |
Stan
2.10.0
probability, sampling & optimization
|
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, VectorT > | UpdateT |
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 |
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.
typedef Eigen::Matrix<Scalar, DimAtCompile, DimAtCompile> stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >::HessianT |
Definition at line 21 of file lbfgs_update.hpp.
typedef boost::tuple<Scalar, VectorT, VectorT> stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >::UpdateT |
Definition at line 23 of file lbfgs_update.hpp.
typedef Eigen::Matrix<Scalar, DimAtCompile, 1> stan::optimization::LBFGSUpdate< Scalar, DimAtCompile >::VectorT |
Definition at line 20 of file lbfgs_update.hpp.
|
inlineexplicit |
Definition at line 25 of file lbfgs_update.hpp.
|
inline |
Compute the search direction based on the current (inverse) Hessian approximation and given gradient.
[out] | pk | The negative product of the inverse Hessian and gradient direction gk. |
[in] | gk | Gradient direction. |
Definition at line 76 of file lbfgs_update.hpp.
|
inline |
Set the number of inverse Hessian updates to keep.
L | New size of buffer. |
Definition at line 32 of file lbfgs_update.hpp.
|
inline |
Add a new set of update vectors to the history.
yk | Difference between the current and previous gradient vector. |
sk | Difference between the current and previous state vector. |
reset | Whether to reset the approximation, forgetting about previous values. |
Definition at line 47 of file lbfgs_update.hpp.
|
protected |
Definition at line 112 of file lbfgs_update.hpp.
|
protected |
Definition at line 113 of file lbfgs_update.hpp.