22 #ifndef __MLPACK_METHODS_LMF_UPDATE_RULES_NMF_ALS_HPP
23 #define __MLPACK_METHODS_LMF_UPDATE_RULES_NMF_ALS_HPP
44 template<
typename MatType>
45 void Initialize(
const MatType& dataset,
const size_t rank)
63 template<
typename MatType>
64 inline static void WUpdate(
const MatType& V,
70 W = V * H.t() * pinv(H * H.t());
73 for (
size_t i = 0; i < W.n_elem; i++)
94 template<
typename MatType>
95 inline static void HUpdate(
const MatType& V,
99 H = pinv(W.t() * W) * W.t() * V;
102 for (
size_t i = 0; i < H.n_elem; i++)