pub struct SparseDictFit {
pub decoder: Array2<f32>,
pub indices: Array2<u32>,
pub codes: Array2<f32>,
pub explained_variance: f64,
pub epochs: usize,
pub converged: bool,
pub active: usize,
}Expand description
Result of a collapsed-linear-lane fit.
The routing is stored fixed-width and sparse: indices[N, s] /
codes[N, s]. There is deliberately no dense N×K assignment matrix —
reconstructing it would defeat the purpose of the lane.
Fields§
§decoder: Array2<f32>Decoder, K×P, unit-norm rows (one atom per row).
indices: Array2<u32>Active atom indices per row, N×s (column j of row i is the j-th
active atom for that row). Rows with fewer than s live atoms pad with
repeated indices whose matching code is zero.
codes: Array2<f32>Sparse codes per row, N×s, aligned with Self::indices.
explained_variance: f64Final held-in explained variance (1 − RSS/TSS).
epochs: usizeNumber of epochs actually run.
converged: boolWhether the EV-improvement tolerance was reached.
active: usizeActive budget s actually used (min(active, K)).
Implementations§
Source§impl SparseDictFit
impl SparseDictFit
Sourcepub fn reconstruct(&self) -> Array2<f32>
pub fn reconstruct(&self) -> Array2<f32>
Dense reconstruction N×P of the training rows from the sparse routing.
This does allocate an N×P array (the data size, not N×K); it exists
for diagnostics / EV checks, not as part of the trainer’s hot loop.
Trait Implementations§
Source§impl Clone for SparseDictFit
impl Clone for SparseDictFit
Source§fn clone(&self) -> SparseDictFit
fn clone(&self) -> SparseDictFit
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 SparseDictFit
impl RefUnwindSafe for SparseDictFit
impl Send for SparseDictFit
impl Sync for SparseDictFit
impl Unpin for SparseDictFit
impl UnsafeUnpin for SparseDictFit
impl UnwindSafe for SparseDictFit
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.