HessianUpdateStrategy#
- class scipy.optimize.HessianUpdateStrategy[source]#
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
andget_matrix
. The matrix multiplication operator@
is also defined to call thedot
method.Methods
dot
(p)Compute the product of the internal matrix with the given vector.
Return current internal matrix.
initialize
(n, approx_type)Initialize internal matrix.
update
(delta_x, delta_grad)Update internal matrix.
Notes
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.