Skip to main content

Module dictionary

Module dictionary 

Source

Structs§

LinearDictionaryConfig
LinearDictionaryConvergence
Fixed-point evidence attached to every converged LinearDictionaryFit.
LinearDictionaryFit
A converged linear-dictionary model. This struct exists ONLY for a certified fit (SPEC 20): the coordinate-descent solver returns it exclusively when the EV-plateau convergence test fired, and non-convergence is an error carrying its evidence (sweeps run, last EV, last improvement, tolerance) — never a degraded/best-effort fit. The closed-form K=1 lanes are converged by construction (a single exact eigensolve).

Enums§

LinearDictionaryAssignment
LinearDictionaryError
Typed failure from fit_linear_dictionary.

Functions§

fit_linear_dictionary
Fit a linear (flat) dictionary by block coordinate descent: each sweep re-routes rows to atoms (the assignment step) and then refines every atom and its assignment column by a penalized least-squares update against the residual.
linear_dictionary_transform
Encode held-out rows x (M x P) against a frozen dictionary atoms (K x P) using the same top-top_k ridge least-squares routing the fit uses against its final atoms. Returns the (M, K) sparse code matrix.