28 #ifndef __MLPACK_METHODS_LMF_UPDATE_RULES_NMF_ALS_HPP
29 #define __MLPACK_METHODS_LMF_UPDATE_RULES_NMF_ALS_HPP
45 template<
typename MatType>
46 void Initialize(
const MatType& dataset,
const size_t rank)
64 template<
typename MatType>
65 inline static void WUpdate(
const MatType& V,
71 W = V * H.t() * pinv(H * H.t());
74 for (
size_t i = 0; i < W.n_elem; i++)
95 template<
typename MatType>
96 inline static void HUpdate(
const MatType& V,
100 H = pinv(W.t() * W) * W.t() * V;
103 for (
size_t i = 0; i < H.n_elem; i++)
static void WUpdate(const MatType &V, arma::mat &W, const arma::mat &H)
The update rule for the basis matrix W.
void Initialize(const MatType &dataset, const size_t rank)
static void HUpdate(const MatType &V, const arma::mat &W, arma::mat &H)
The update rule for the encoding matrix H.
The alternating least square update rules of matrices W and H.