Interface HessianUpdateStrategy
- All Superinterfaces:
BiFunction<Matrix,Object, Matrix>
- All Known Implementing Classes:
BFGS,FullHessianUpdateStrategy,SR1
Interface for implementing Hessian update strategies.
Many optimization methods make use of Hessian (or inverse Hessian)
approximations, such as the quasi-Newton methods BFGS, SR1, L-BFGS.
Some of these approximations, however, do not actually need to store
the entire matrix or can compute the internal matrix product with a
given vector in a very efficiently manner. This class serves as an
abstract interface between the optimization algorithm and the
quasi-Newton update strategies, giving freedom of implementation
to store and update the internal matrix as efficiently as possible.
Different choices of initialization and update procedure will result
in different quasi-Newton strategies.
Four methods should be implemented in derived classes: ``initialize``,
``update``, ``dot`` and ``get_matrix``.
Any instance of a class that implements this interface,
can be accepted by the method ``minimize`` and used by
the compatible solvers to approximate the Hessian (or
inverse Hessian) used by the optimization algorithms.
-
Method Summary
Modifier and TypeMethodDescriptionReturn current internal matrix.voidinitialize(long n, HessianApproximationType approxType) Initialize internal matrix.voidUpdate internal matrix.Methods inherited from interface java.util.function.BiFunction
andThen, apply
-
Method Details
-
initialize
Initialize internal matrix.Allocate internal memory for storing and updating the Hessian or its inverse.
- Parameters:
n- Problem dimension.approxType- Selects either the Hessian or the inverse Hessian. When set to 'hess' the Hessian will be stored and updated. When set to 'inv_hess' its inverse will be used instead.
-
update
Update internal matrix.Update Hessian matrix or its inverse (depending on how 'approx_type' is defined) using information about the last evaluated points.
- Parameters:
deltaX- The difference between two points the gradient function have been evaluated at: ``delta_x = x2 - x1``.deltaG- The difference between the gradients: ``delta_grad = grad(x2) - grad(x1)``.
-
getMatrix
Matrix getMatrix()Return current internal matrix.- Returns:
- Dense matrix containing either the Hessian or its inverse (depending on how 'approx_type' is defined).
-