BFGS#
- class scipy.optimize.BFGS(exception_strategy='skip_update', min_curvature=None, init_scale='auto')[source]#
Broyden-Fletcher-Goldfarb-Shanno (BFGS) Hessian update strategy.
- Parameters:
- exception_strategy{βskip_updateβ, βdamp_updateβ}, optional
Define how to proceed when the curvature condition is violated. Set it to βskip_updateβ to just skip the update. Or, alternatively, set it to βdamp_updateβ to interpolate between the actual BFGS result and the unmodified matrix. Both exceptions strategies are explained in [1], p.536-537.
- min_curvaturefloat
This number, scaled by a normalization factor, defines the minimum curvature
dot(delta_grad, delta_x)
allowed to go unaffected by the exception strategy. By default is equal to 1e-8 whenexception_strategy = 'skip_update'
and equal to 0.2 whenexception_strategy = 'damp_update'
.- init_scale{float, np.array, βautoβ}
This parameter can be used to initialize the Hessian or its inverse. When a float is given, the relevant array is initialized to
np.eye(n) * init_scale
, wheren
is the problem dimension. Alternatively, if a precisely(n, n)
shaped, symmetric array is given, this array will be used. Otherwise an error is generated. Set it to βautoβ in order to use an automatic heuristic for choosing the initial scale. The heuristic is described in [1], p.143. The default is βautoβ.
Methods
dot
(p)Compute the product of the internal matrix with the given vector.
Return the current internal matrix.
initialize
(n, approx_type)Initialize internal matrix.
update
(delta_x, delta_grad)Update internal matrix.
Notes
The update is based on the description in [1], p.140.
References