pub struct SparseDictConfig {
pub n_atoms: usize,
pub active: usize,
pub minibatch: usize,
pub max_epochs: usize,
pub score_tile: usize,
pub code_ridge: f32,
pub decoder_ridge: f32,
pub tolerance: f64,
}Expand description
Shared (NOT per-atom) hyper-parameters for the collapsed linear lane.
The whole point of the sparse trainer is that K is too large to carry a
per-atom smoothing parameter / Newton state; every knob here is a single
scalar shared across the entire dictionary.
Fields§
§n_atoms: usizeDictionary width K (number of atoms).
active: usizeActive budget s: how many atoms may fire per row (top_s). This is the
shared routing-sparsity hyper-parameter.
minibatch: usizeMinibatch size (rows per route→code→accumulate step). The decoder is refreshed once per full epoch from the accumulated sparse normal equations, so this only bounds peak working set, not the solution.
max_epochs: usizeNumber of full passes over the data.
score_tile: usizeColumn tile width used when scoring rows against the dictionary. Score
tiles of shape minibatch × tile are formed and discarded; the N×K
score matrix is never materialised.
code_ridge: f32Shared ridge on the per-row active-set code solve (Tikhonov on the
s×s Gram). Identifies the codes when active atoms are collinear.
decoder_ridge: f32Shared ridge on the per-atom decoder refresh (method-of-optimal -directions normal equations). Keeps a thinly-used atom well posed.
tolerance: f64Relative explained-variance improvement below which training stops.
Implementations§
Trait Implementations§
Source§impl Clone for SparseDictConfig
impl Clone for SparseDictConfig
Source§fn clone(&self) -> SparseDictConfig
fn clone(&self) -> SparseDictConfig
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 SparseDictConfig
Source§impl Debug for SparseDictConfig
impl Debug for SparseDictConfig
Auto Trait Implementations§
impl Freeze for SparseDictConfig
impl RefUnwindSafe for SparseDictConfig
impl Send for SparseDictConfig
impl Sync for SparseDictConfig
impl Unpin for SparseDictConfig
impl UnsafeUnpin for SparseDictConfig
impl UnwindSafe for SparseDictConfig
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.