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++)
static void WUpdate(const MatType &V, arma::mat &W, const arma::mat &H)
The update rule for the basis matrix W.
Linear algebra utility functions, generally performed on matrices or vectors.
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.
This class implements a method titled 'Alternating Least Squares' described in the paper 'Positive Ma...
NMFALSUpdate()
Empty constructor required for the UpdateRule template.