pub struct LogBiasTable { /* private fields */ }Expand description
Precomputed observed − expected log-transition table for a fixed model
pair. The effective-length correction evaluates log_bias for a context at
every transcript position; log_bias evaluates BOTH models (each
re-encoding the context and sweeping all CONTEXT_LENGTH positions), so a
context costs two encodes + two table sweeps. Folding the pair into a single
difference table diff[pos·ROWS+idx] = obs − exp (built once per quant run,
the models being fixed during correction) collapses that to one encode +
one sweep — ~1.4× on the per-position factor build, the dominant cost of
the seqBias sweep.
eval equals log_bias(obs, exp, ctx, rc) up to floating-point
reassociation: it sums Σ(obs−exp) rather than (Σobs) − (Σexp), a
difference of ~1e-15 per context (machine epsilon), far below quant-output
resolution.
Implementations§
Auto Trait Implementations§
impl Freeze for LogBiasTable
impl RefUnwindSafe for LogBiasTable
impl Send for LogBiasTable
impl Sync for LogBiasTable
impl Unpin for LogBiasTable
impl UnsafeUnpin for LogBiasTable
impl UnwindSafe for LogBiasTable
Blanket Implementations§
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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.