pub struct AdaptiveTraceEvidence {
pub logdet_hessian: f64,
pub traces: Array1<f64>,
pub stderrs: Array1<f64>,
pub probe_count: usize,
pub converged: bool,
}Expand description
Adaptive-K Hutchinson trace schedule with common random numbers (CRN).
Repeatedly invokes evidence_derivatives_hutchinson_gpu with probe
counts K = 16, 32, 64, 128, stopping at the first K that satisfies
the per-coordinate relative-SE criterion
max_j s_j / (sqrt(K) · max(|t_j|, τ)) ≤ εwhere s_j is the sample standard deviation across the K probes (the
raw quadratic-form sample, without the (1/2) REML logdet scaling)
and t_j is the running mean. Because the SplitMix probe RNG is
stateless ((seed, k_index, i) → ±1), the first K_prev probes of a
K = 2·K_prev re-run are bit-identical to the previous batch, so each
step extends the prior estimate rather than starting fresh in
expectation. The implementation re-runs from scratch at each K for
simplicity; CRN is preserved by the stateless RNG seed.
Returns the raw traces t_j = tr(H⁻¹ H_j) = mean_k q_{j,k}
(length D), the log|H| from the cached Cholesky, and the final
probe count K actually used. The raw traces (not the (1/2) REML
logdet gradient) are what the outer evaluator wants — it applies the
logdet-gradient half-factor itself.
Fields§
§logdet_hessian: f64§traces: Array1<f64>§stderrs: Array1<f64>Per-probe sample standard deviation of the raw trace estimator
q_{j,·} (NOT divided by sqrt(K)); divide by sqrt(probe_count)
to obtain the standard error of the running mean traces[j].
probe_count: usize§converged: boolAuto Trait Implementations§
impl Freeze for AdaptiveTraceEvidence
impl RefUnwindSafe for AdaptiveTraceEvidence
impl Send for AdaptiveTraceEvidence
impl Sync for AdaptiveTraceEvidence
impl Unpin for AdaptiveTraceEvidence
impl UnsafeUnpin for AdaptiveTraceEvidence
impl UnwindSafe for AdaptiveTraceEvidence
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> 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.