pub struct OuterGradientFdComponent {
pub block: String,
pub index: usize,
pub analytic: f64,
pub fd: f64,
pub fd_refined: Option<f64>,
}Expand description
Per-θ component of an outer-gradient finite-difference audit.
Fields§
§block: StringHuman label for the block this coordinate belongs to (e.g. “timewiggle”).
index: usizeFlat θ index.
analytic: f64Analytic ∂V/∂θ_i returned by the family evaluator.
fd: f64Second-order central finite-difference of the outer criterion in θ_i at
the coarse step h. Its leading error is O(h²)·V''', which is large
on a steeply-curved coordinate (e.g. the Matérn log-κ axis, whose
operator penalty scales like κ^{2m}, m = ν + d/2).
fd_refined: Option<f64>Richardson 4th-order refinement of fd, combining the h and h/2
central differences to cancel the leading O(h²) truncation term
(residual O(h⁴)). Populated ONLY when the coarse fd gap looks like it
might trip the DESYNC band, so clean coordinates stay cheap (2 evals);
suspicious ones pay 2 extra evals to tell genuine derivative error
(h-independent gap) apart from pure FD truncation (h²-shrinking gap).
Implementations§
Source§impl OuterGradientFdComponent
impl OuterGradientFdComponent
Sourcepub fn best_fd(&self) -> f64
pub fn best_fd(&self) -> f64
The FD estimate that best matches the analytic gradient — the
Richardson-refined value when it is closer, else the coarse fd.
Picking the closer of the two is deliberately CONSERVATIVE for the
desync verdict: a true derivative bug makes the analytic gradient differ
from the true derivative by an h-independent amount, so BOTH the
coarse and the refined FD (each converging to that true derivative)
stay far from it — the min gap remains large and DESYNC still fires.
Only a truncation-dominated gap (where refinement recovers the true
derivative) collapses, which is exactly the case that must NOT be
flagged. So abs_gap can only shrink vs the coarse-only value: no
previously-passing audit can regress.
Trait Implementations§
Source§impl Clone for OuterGradientFdComponent
impl Clone for OuterGradientFdComponent
Source§fn clone(&self) -> OuterGradientFdComponent
fn clone(&self) -> OuterGradientFdComponent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for OuterGradientFdComponent
impl RefUnwindSafe for OuterGradientFdComponent
impl Send for OuterGradientFdComponent
impl Sync for OuterGradientFdComponent
impl Unpin for OuterGradientFdComponent
impl UnsafeUnpin for OuterGradientFdComponent
impl UnwindSafe for OuterGradientFdComponent
Blanket Implementations§
impl<T> Allocation 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.