pub fn compute_objective<F: BixverseFloat + Send + Sync>(
sq_frob_v: F,
h: MatRef<'_, F>,
a: MatRef<'_, F>,
b: MatRef<'_, F>,
d: MatRef<'_, F>,
) -> FExpand description
Frobenius squared reconstruction error.
Evaluates ||V - WH||_F^2 via the expansion
||V||_F^2 - 2<W^T V, H> + <W^T W, H H^T>,
avoiding materialising W H. Always in f64 to avoid issues with
catastrophic cancellation.
§Params
sq_frob_v- Precomputed||V||_F^2.h- Right factork x n.a- ProductW^T V, shapek x n.b- Gram matrixW^T W, shapek x k.d- Gram matrixH H^T, shapek x k.
§Returns
The scalar reconstruction error.