zdebruine / RcppML

Rcpp Machine Learning: Fast robust NMF, divisive clustering, and more
GNU General Public License v2.0
89 stars 15 forks source link

Alternative Strategy for NNLS Updates #41

Closed zdebruine closed 1 year ago

zdebruine commented 1 year ago

Current NMF updates use a step of $\frac{-W^TA_{:j}}{W^TW}$ for updates of $H$ with Sequential Coordinate Descent (SCD).

We could avoid SCD by adding an additional term to the updates: $\frac{W^TWH{:j} - W^TA:j}{W^TW}$ for updates of $H$. The same logic applies to updates of $W$. Since we already have $a = W^TW$, the only additional operations we have are $aH_{:j}$ (which is very cheap) and the subtraction of the two terms in the numerator. This is likely to be faster, but it is unclear whether the convergence properties will be as excellent. Perhaps an adam optimizer would be applicable to this update, while it does not benefit ALS SCD.

zdebruine commented 1 year ago

This line b -= a.col(i) * -h(i, col); in the nnls solver was the source of confusion... Resolved!