API — Subspace Methods

Abstract type

Two-Dimensional Subspace

Retro.TwoDimSubspaceType
TwoDimSubspace <: AbstractSubspace

Two-dimensional subspace spanned by gradient direction and Newton/curvature direction. Uses StaticArrays for zero-allocation computations in the 2D subspace.

Fields

  • normalize::Bool: Whether to normalize basis vectors (default: true)
source

Conjugate-Gradient Subspace

Retro.CGSubspaceType
CGSubspace <: AbstractSubspace

Conjugate Gradient subspace method for large-scale problems. Incrementally builds Krylov subspace using Hessian-vector products.

Fields

  • max_cg_iter::Int: Maximum CG iterations (default: min(n, 50))
  • cg_tol::Real: CG tolerance (default: 1e-6)
source

Full Space

Retro.FullSpaceType
FullSpace <: AbstractSubspace

Full-space trust-region method. This method constructs the full Hessian matrix and solves the trust-region subproblem in the original space. It is more expensive than subspace methods, but can be more accurate for small to medium-sized problems.

source

Common interface

Retro.init_subspace!Function
init_subspace!(subspace, cache) -> state

Initialise the subspace method, returning an opaque state object.

source
Retro.build_subspace!Function
build_subspace!(subspace, state, cache, hess_approx, hess_state, x)

Build the subspace basis vectors and the reduced gradient / Hessian for the current iterate x.

source
Retro.solve_subspace_tr!Function
solve_subspace_tr!(solver, subspace, state, cache, Δ) -> predicted_reduction

Solve the trust-region subproblem within the subspace. Writes the step into cache.p and returns the predicted reduction.

source