12 #ifndef MLPACK_METHODS_AMF_AVERAGE_INIT_HPP 13 #define MLPACK_METHODS_AMF_AVERAGE_INIT_HPP 42 template<
typename MatType>
48 const size_t n = V.n_rows;
49 const size_t m = V.n_cols;
56 for (
typename MatType::const_row_col_iterator it = V.begin();
65 avgV = sqrt(((avgV / (n * m)) - min) / r);
85 template<
typename MatType>
89 const bool whichMatrix =
true)
91 const size_t n = V.n_rows;
92 const size_t m = V.n_cols;
99 for (
typename MatType::const_row_col_iterator it = V.begin();
117 M += sqrt(((avgV / (n * m)) - min) / r);
121 template<
typename Archive>
static void Initialize(const MatType &V, const size_t r, arma::mat &W, arma::mat &H)
Initialize the matrices W and H to the average value of V with uniform random noise added...
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
static void InitializeOne(const MatType &V, const size_t r, arma::mat &M, const bool whichMatrix=true)
Initialize the matrix W or H to the average value of V with uniform random noise added.
This initialization rule initializes matrix W and H to root of the average of V, perturbed with unifo...
void serialize(Archive &, const uint32_t)
Serialize the object (in this case, there is nothing to do).