pub enum HessianFallbackPolicy {
Error,
FiniteDifference,
}Expand description
What NewtonTrustRegion / Arc should do when an objective returns
SecondOrderSample { hessian: None } (i.e. no analytic Hessian was
supplied for this evaluation).
The default is FiniteDifference for backward compatibility with
opt 0.2.x. Callers with exact analytic Hessians should set
Error: a single None then surfaces as a fatal evaluation error
instead of silently triggering O(n) extra gradient probes per
iteration. This matters most when each gradient probe is itself
expensive (nested solves, biobank-scale outer iterations).
Variants§
Error
Treat a missing Hessian as a fatal evaluation error. Use this
when the caller guarantees the objective always supplies an
analytic Hessian — a None then indicates a routing/contract
mismatch and should fail loudly rather than be papered over by
finite differences.
FiniteDifference
Estimate the Hessian by finite-differencing the gradient when
it is missing. This is the historical default. Step size comes
from with_fd_hessian_step.
Trait Implementations§
Source§impl Clone for HessianFallbackPolicy
impl Clone for HessianFallbackPolicy
Source§fn clone(&self) -> HessianFallbackPolicy
fn clone(&self) -> HessianFallbackPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HessianFallbackPolicy
Source§impl Debug for HessianFallbackPolicy
impl Debug for HessianFallbackPolicy
Source§impl Default for HessianFallbackPolicy
impl Default for HessianFallbackPolicy
impl Eq for HessianFallbackPolicy
Source§impl PartialEq for HessianFallbackPolicy
impl PartialEq for HessianFallbackPolicy
impl StructuralPartialEq for HessianFallbackPolicy
Auto Trait Implementations§
impl Freeze for HessianFallbackPolicy
impl RefUnwindSafe for HessianFallbackPolicy
impl Send for HessianFallbackPolicy
impl Sync for HessianFallbackPolicy
impl Unpin for HessianFallbackPolicy
impl UnsafeUnpin for HessianFallbackPolicy
impl UnwindSafe for HessianFallbackPolicy
Blanket Implementations§
impl<T> Boilerplate for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more