modopt.approximate_hessians
|
Broyden-Fletcher-Goldfarb-Shanno (BFGS) Hessian update. |
|
Broyden-Fletcher-Goldfarb-Shanno (BFGS) Hessian update using SciPy's BFGS implementation. |
|
Symmetric rank-one (SR1) Hessian update. |
|
Davidon-Fletcher-Powell (DFP) Hessian update. |
|
Powell-Symmetric-Broyden (PSB) Hessian update. |
- class modopt.approximate_hessians.BFGS(**kwargs)[source]
Broyden-Fletcher-Goldfarb-Shanno (BFGS) Hessian update.
- Parameters
- nxint
Number of optimization variables.
- store_hessianbool, default=True
Store the Hessian approximation.
- store_inversebool, default=False
Store the inverse Hessian approximation.
- Attributes
- B_knp.ndarray
Hessian approximation of shape (nx, nx). Available only if
store_hessianisTrue.- M_knp.ndarray
Inverse Hessian approximation of shape (nx, nx). Available only if
store_inverseisTrue.
Methods
update(d, w)Update the stored Hessian approximation B_k or its inverse M_k using the BFGS formula.
- class modopt.approximate_hessians.BFGSScipy(**kwargs)[source]
Broyden-Fletcher-Goldfarb-Shanno (BFGS) Hessian update using SciPy’s BFGS implementation.
- Parameters
- nxint
Number of optimization variables.
- store_hessianbool, default=True
Store the Hessian approximation.
- store_inversebool, default=False
Store the inverse Hessian approximation.
- min_curvaturefloat, default=0.0
Curvature below which
exception_strategyis triggered. Default is 1e-8 whenexception_strategy = 'skip_update'and 0.2 whenexception_strategy = 'damp_update'.- exception_strategy{‘skip_update’, ‘damp_update’}, default=’damp_update’
Strategy to proceed when the
min_curvaturecondition is violated.‘skip_update’: Skip the update and keep the previous approximation.
‘damp_update’: Interpolate between the computed BFGS update and the previous approximation.
- init_scale{float, ‘auto’, np.ndarray}, default=’auto’
Initial scaling for the Hessian approximation. - float: Use
init_scale*np.eye(nx)as the initial approximation. - ‘auto’: Use an automatic heuristic to compute the initial scaling factor. - np.ndarray: Use the provided array as the initial approximation. The array must be of shape (nx, nx), symmetric, and positive definite. Note that this option only works for SciPy >= 1.14.0.
- Attributes
- B_knp.ndarray
Hessian approximation of shape (nx, nx). Available only if
store_hessianisTrue.- M_knp.ndarray
Inverse Hessian approximation of shape (nx, nx). Available only if
store_inverseisTrue.
Methods
update(d, w)Update the stored Hessian approximation B_k or its inverse M_k using the BFGS formula.
- class modopt.approximate_hessians.SR1(**kwargs)[source]
Symmetric rank-one (SR1) Hessian update.
- Parameters
- nxint
Number of optimization variables.
- Attributes
- B_knp.ndarray
Hessian approximation of shape (nx, nx).
Methods
update(d, w)Update the stored Hessian approximation B_k using the SR1 formula.
- class modopt.approximate_hessians.DFP(**kwargs)[source]
Davidon-Fletcher-Powell (DFP) Hessian update.
- Parameters
- nxint
Number of optimization variables.
- store_hessianbool, default=False
Store the Hessian approximation.
- store_inversebool, default=True
Store the inverse Hessian approximation.
- Attributes
- B_knp.ndarray
Hessian approximation of shape (nx, nx). Available only if
store_hessianisTrue.- M_knp.ndarray
Inverse Hessian approximation of shape (nx, nx). Available only if
store_inverseisTrue.
Methods
update(d, w)Update the stored Hessian approximation B_k or its inverse M_k using the DFP formula.
- class modopt.approximate_hessians.PSB(**kwargs)[source]
Powell-Symmetric-Broyden (PSB) Hessian update.
- Parameters
- nxint
Number of optimization variables.
- Attributes
- B_knp.ndarray
Hessian approximation of shape (nx, nx).
Methods
update(d, w)Update the stored Hessian approximation B_k using the PSB formula.