API — Subspace Methods
Abstract type
Retro.AbstractSubspace — Type
AbstractSubspaceSupertype for subspace strategies used to reduce the trust-region subproblem.
Concrete subtypes: TwoDimSubspace, CGSubspace, FullSpace.
Two-Dimensional Subspace
Retro.TwoDimSubspace — Type
TwoDimSubspace <: AbstractSubspaceTwo-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)
Conjugate-Gradient Subspace
Retro.CGSubspace — Type
CGSubspace <: AbstractSubspaceConjugate 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)
Full Space
Retro.FullSpace — Type
FullSpace <: AbstractSubspaceFull-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.
Common interface
Retro.init_subspace! — Function
init_subspace!(subspace, cache) -> stateInitialise the subspace method, returning an opaque state object.
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.
Retro.solve_subspace_tr! — Function
solve_subspace_tr!(solver, subspace, state, cache, Δ) -> predicted_reductionSolve the trust-region subproblem within the subspace. Writes the step into cache.p and returns the predicted reduction.