12 #ifndef MLPACK_METHODS_LMF_UPDATE_RULES_NMF_ALS_HPP 13 #define MLPACK_METHODS_LMF_UPDATE_RULES_NMF_ALS_HPP 51 template<
typename MatType>
71 template<
typename MatType>
72 inline static void WUpdate(
const MatType& V,
78 W = V * H.t() * pinv(H * H.t());
81 for (
size_t i = 0; i < W.n_elem; ++i)
104 template<
typename MatType>
109 H = pinv(W.t() * W) * W.t() * V;
112 for (
size_t i = 0; i < H.n_elem; ++i)
122 template<
typename Archive>
Linear algebra utility functions, generally performed on matrices or vectors.
void Initialize(const MatType &, const size_t)
Set initial values for the factorization.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void serialize(Archive &, const uint32_t)
Serialize the object (in this case, there is nothing to serialize).
NMFALSUpdate()
Empty constructor required for the UpdateRule template.
static void WUpdate(const MatType &V, arma::mat &W, const arma::mat &H)
The update rule for the basis matrix W.
This class implements a method titled 'Alternating Least Squares' described in the following paper: ...
static void HUpdate(const MatType &V, const arma::mat &W, arma::mat &H)
The update rule for the encoding matrix H.