Expand description
Implementation of NMF, dense and sparse paths. This version implements HALS with random or NNDSVD initialisation.
Modules§
- consensus
- Consensus NMF: turns the random restarts from
super::stabilised_nmfinto a stability score and a consensus factor, plus a driver loop over k so the rank can be chosen from the stability and error curves. - dense
- Dense backend for NMF. Borrows V as a faer
MatRefand routes both data products throughutils::gemm::gemm. - nmf_
preprocessing - Pre-processing methods for NMF on sparse and dense data.
- refit
- Fixed-factor NNLS refits. Solves for one factor while the other is frozen, which is what a consensus NMF needs once the consensus factor has been assembled from the clustered restarts.
- sparse
- Sparse backend for NMF. Holds the chosen layer of V as CSC and CSR with
storage type
S; widens to compute typeFper element inside two hand-rolled spMM kernels.
Structs§
- Hals
Opts - HALS solver options.
- NmfResult
- Result of a single NMF run.
- Stabilised
NmfResult - Result of stabilised NMF across random restarts.
Enums§
- NmfInit
- Initialisation strategy for HALS.
Traits§
- NmfInput
- Backend-agnostic view of V for HALS NMF. Implementations write the two data-touching products into caller-owned buffers.
Functions§
- compute_
objective - Frobenius squared reconstruction error.
- gram_
h_ ht - Gram matrix H H^T.
- gram_
wt_ w - Gram matrix W^T W.
- hals_
sweep_ cols - HALS column sweep for W.
- hals_
sweep_ rows - HALS row sweep for H.
- nmf_
hals - Frobenius HALS NMF.
- nndsvd_
from_ svd - Boutsidis-Gallopoulos NNDSVD from a top-k truncated SVD.
- normalise_
w_ cols - Normalise columns of W to unit L2 norm.
- parse_
nmf_ init - Parse the NMF initialisation
- random_
init - Random initialisation
- stabilised_
nmf - Stabilised NMF via random restarts.