14 #ifndef __MLPACK_METHODS_LMF_UPDATE_RULES_NMF_ALS_HPP 15 #define __MLPACK_METHODS_LMF_UPDATE_RULES_NMF_ALS_HPP 53 template<
typename MatType>
73 template<
typename MatType>
74 inline static void WUpdate(
const MatType& V,
80 W = V * H.t() * pinv(H * H.t());
83 for (
size_t i = 0; i < W.n_elem; i++)
106 template<
typename MatType>
111 H = pinv(W.t() * W) * W.t() * V;
114 for (
size_t i = 0; i < H.n_elem; i++)
124 template<
typename Archive>
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 &, const size_t)
Set initial values for the factorization.
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 following paper: ...
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
NMFALSUpdate()
Empty constructor required for the UpdateRule template.
void Serialize(Archive &, const unsigned int)
Serialize the object (in this case, there is nothing to serialize).