pub fn cp_als(
tensor: &DenseTensor,
rank: usize,
max_iter: usize,
tol: f64,
) -> CpDecompositionExpand description
Alternating Least Squares (ALS) for CP decomposition of a 3-way tensor.
Decomposes tensor (shape n0 × n1 × n2) into rank components.
Returns the factor matrices A (n0×rank), B (n1×rank), C (n2×rank) and
normalisation weights λ.
§Arguments
tensor– reference to aDenseTensorwith rank 3rank– number of CP componentsmax_iter– maximum ALS iterationstol– relative reconstruction error tolerance for convergence