|
LSLOpt
1.0
|
L-BFGS storage. More...
#include <LBFGSStorage.hpp>
Public Member Functions | |
| LBFGSStorage (Eigen::Index n, Eigen::Index m, Scalar epsilon, OutputFunction &output_function) | |
| Construct a BFGS storage. More... | |
| void | reset () |
| Reset the (inverse) Hessian approximation to identity matrix. More... | |
| Vector< Scalar > | calculate_Hv (const Vector< Scalar > &v, const Vector< Scalar > &STv, const Vector< Scalar > &YTv) |
Calculate product of inverse Hessian approximation with vector . More... | |
| Vector< Scalar > | calculate_Hv (const Vector< Scalar > &v) |
Calculate product of inverse Hessian approximation with vector . More... | |
| Scalar | calculate_vHv (const Vector< Scalar > &v) |
Calculate normalized scalar product of vector with inverse Hessian approximation . More... | |
| Vector< Scalar > | calculate_Bv (const Vector< Scalar > &v, const Vector< Scalar > &STv, const Vector< Scalar > &YTv) |
Calculate product of Hessian approximation with vector . More... | |
| Vector< Scalar > | calculate_Bv (const Vector< Scalar > &v) |
Calculate product of Hessian approximation with vector . More... | |
| Scalar | calculate_vBv (const Vector< Scalar > &v) |
Calculate normalized scalar product of vector with Hessian approximation . More... | |
| Matrix< Scalar > | calculate_B () |
Calculate the Hessian matrix approximation . More... | |
| bool | update (const Vector< Scalar > &s, const Vector< Scalar > &y, const Vector< Scalar > &g) |
| Update the (inverse) Hessian approximation. More... | |
| void | resize (Eigen::Index b) |
Function that resizes the storage to b. More... | |
Public Attributes | |
| Eigen::Index | n |
| Dimensionality of the problem. | |
| Eigen::Index | m |
| Maximal number of update pairs to store. | |
| Eigen::Index | b |
| Current number of stored update pairs. | |
| Matrix< Scalar > | W |
working matrix | |
| Matrix< Scalar > | M |
working matrix | |
| Matrix< Scalar > | S |
matrix storing the last vectors | |
| Matrix< Scalar > | Y |
matrix storing the last vectors | |
| Matrix< Scalar > | R |
helper matrix | |
| Matrix< Scalar > | L |
helper matrix | |
| Matrix< Scalar > | D |
helper matrix | |
| Matrix< Scalar > | YTY |
matrix storing | |
| Matrix< Scalar > | STS |
matrix storing | |
| Matrix< Scalar > | LOW |
working matrix | |
| Matrix< Scalar > | UPP |
working matrix | |
| Scalar | gamma = Scalar{1} |
| current scaling of the inverse Hessian | |
| Scalar | epsilon |
| numerical stability check epsilon | |
| OutputFunction & | output_function |
| output function for status messages. | |
L-BFGS storage.
| Scalar | The scalar type of vector/matrix coefficients. |
This is the implementation of the limited memory BFGS algorithm. Here, the approximation of the (inverse) Hessian is stored as the last m update pairs.
It requires
storage.
We use the matrix representation described in
Byrd, R.H., Nocedal, J., Schnable, R.B. Representation of quasi-Newton matrices and their use in limited memory methods. 1994. Mathematical Programming. 63. 129-156.
Byrd, R.H., Lu, P., Nocedal, J., Zhu, C. A Limited Memory Algorithm for Bound Constrained Optimization. 1995. SIAM Journal of Scientific and Statistical Computing. 16(5). 1190-1208.
| LSLOpt::Implementation::LBFGSStorage< Scalar, OutputFunction >::LBFGSStorage | ( | Eigen::Index | n, |
| Eigen::Index | m, | ||
| Scalar | epsilon, | ||
| OutputFunction & | output_function | ||
| ) |
Construct a BFGS storage.
| n | Dimensionality of the problem. |
| m | Number update pairs to store. |
| epsilon | Small value for numerical stability check. |
| output_function | Output function for status messages. |
| Matrix< Scalar > LSLOpt::Implementation::LBFGSStorage< Scalar, OutputFunction >::calculate_B | ( | ) |
Calculate the Hessian matrix approximation
.
.| Vector< Scalar > LSLOpt::Implementation::LBFGSStorage< Scalar, OutputFunction >::calculate_Bv | ( | const Vector< Scalar > & | v, |
| const Vector< Scalar > & | STv, | ||
| const Vector< Scalar > & | YTv | ||
| ) |
Calculate product of Hessian approximation
with vector
.
| v | Vector for calculation. |
| STv | Product of the matrix with |
| YTv | Product of the matrix with |
.Runtime
.
| Vector< Scalar > LSLOpt::Implementation::LBFGSStorage< Scalar, OutputFunction >::calculate_Bv | ( | const Vector< Scalar > & | v | ) |
Calculate product of Hessian approximation
with vector
.
| v | Vector for calculation. |
.Runtime
.
| Vector< Scalar > LSLOpt::Implementation::LBFGSStorage< Scalar, OutputFunction >::calculate_Hv | ( | const Vector< Scalar > & | v, |
| const Vector< Scalar > & | STv, | ||
| const Vector< Scalar > & | YTv | ||
| ) |
Calculate product of inverse Hessian approximation
with vector
.
| v | Vector for calculation. |
| STv | Product of the matrix with |
| YTv | Product of the matrix with |
.Runtime
.
| Vector< Scalar > LSLOpt::Implementation::LBFGSStorage< Scalar, OutputFunction >::calculate_Hv | ( | const Vector< Scalar > & | v | ) |
Calculate product of inverse Hessian approximation
with vector
.
| v | Vector for calculation. |
.Runtime
.
| Scalar LSLOpt::Implementation::LBFGSStorage< Scalar, OutputFunction >::calculate_vBv | ( | const Vector< Scalar > & | v | ) |
Calculate normalized scalar product of vector
with Hessian approximation
.
| v | Vector for calculation. |
.Runtime
.
. | Scalar LSLOpt::Implementation::LBFGSStorage< Scalar, OutputFunction >::calculate_vHv | ( | const Vector< Scalar > & | v | ) |
Calculate normalized scalar product of vector
with inverse Hessian approximation
.
| v | Vector for calculation. |
.Runtime
.
| void LSLOpt::Implementation::LBFGSStorage< Scalar, OutputFunction >::reset | ( | ) |
Reset the (inverse) Hessian approximation to identity matrix.
This function deletes all
update pairs.
Runtime
.
| void LSLOpt::Implementation::LBFGSStorage< Scalar, OutputFunction >::resize | ( | Eigen::Index | b | ) |
Function that resizes the storage to b.
| b | New size of the storage. |
If
, then the size of the storage is increased. Otherwise the oldest update pair is deleted.
Runtime
.
| bool LSLOpt::Implementation::LBFGSStorage< Scalar, OutputFunction >::update | ( | const Vector< Scalar > & | s, |
| const Vector< Scalar > & | y, | ||
| const Vector< Scalar > & | g | ||
| ) |
Update the (inverse) Hessian approximation.
| s | Change in x coordinate. |
| y | Change in gradient. |
| g | New gradient. |
true if successful, false otherwiseThe runtime of update is 
The
part stems from the Cholesky decomposition and the inversion of
.
1.8.13