pub enum InitialMetric {
Identity,
Scalar(f64),
Diagonal(Array1<f64>),
DenseInverseHessian(Array2<f64>),
}Expand description
How to seed the BFGS inverse-Hessian approximation H_0^{-1}.
Replaces (and supersedes) the previous with_initial_inverse_hessian
thinking by giving callers a clean choice between scaled-identity
resets and full dense seeds.
Default behavior (when no with_initial_metric is set) is
Identity: BFGS uses its internal scaled-identity initialization.
Variants§
Identity
Default: scaled identity (BFGS picks the scale internally).
Scalar(f64)
H_0^{-1} = scale * I. Useful when the caller has a single
magnitude estimate (e.g. from a previous run’s gradient norm
or from a known curvature scale) but no per-coordinate
information.
Diagonal(Array1<f64>)
H_0^{-1} = diag(diag). Per-coordinate scaling — the typical
shape for penalized likelihoods where the penalty matrix is
near-diagonal in the smoothing-parameter coordinate system.
DenseInverseHessian(Array2<f64>)
A complete dense H_0^{-1}. The matrix is validated for
shape and finiteness at run() time; symmetry is not enforced
(BFGS’s update preserves whatever symmetry the seed has).
Trait Implementations§
Source§impl Clone for InitialMetric
impl Clone for InitialMetric
Source§fn clone(&self) -> InitialMetric
fn clone(&self) -> InitialMetric
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more