API — Hessian Methods

Abstract type

BFGS

Retro.BFGSType
BFGS <: AbstractHessianApproximation

BFGS quasi-Newton Hessian approximation with full matrix storage. Maintains positive definiteness through careful update formula.

Fields

  • B0_scale::Real: Initial Hessian scaling factor (default: 1.0)
  • skip_update::Bool: Whether to skip update if curvature condition fails
  • damped::Bool: Use damped BFGS update for robustness (default: true)
source

Symmetric Rank-1

Retro.SR1Type
SR1 <: AbstractHessianApproximation

Symmetric Rank-1 quasi-Newton Hessian approximation. Does not maintain positive definiteness but can handle indefinite Hessians.

Fields

  • B0_scale::Real: Initial Hessian scaling factor (default: 1.0)
  • skip_threshold::Real: Skip update if denominator is too small
source

Exact Hessian

Retro.ExactHessianType
ExactHessian{T} <: AbstractHessianApproximation

Exact Hessian computed via automatic differentiation (or user-supplied analytic Hessian). Adds a small diagonal regularization to improve conditioning.

Best for small-to-medium problems where the full Hessian is affordable.

Fields

  • regularization::T: Added to diagonal of H for numerical stability (default: 1e-8)
source
Retro.ExactHessianStateType
ExactHessianState{T}

Cached Hessian matrix and the point where it was last computed. Recomputes only when x changes.

source

Common interface

All Hessian approximations implement these methods:

Retro.init_hessian!Function
init_hessian!(approx, cache) -> state

Initialise the Hessian approximation approx, writing the initial matrix into cache.B. Returns an opaque state object that tracks update history.

source
Retro.update_hessian!Function
update_hessian!(approx, state, cache, obj, x)

Update the Hessian approximation stored in cache.B using the latest iterate.

source
Retro.apply_hessian!Function
apply_hessian!(Hv, approx, state, cache, v)

Compute the Hessian-vector product Hv = B * v using the current approximation.

source