13 #ifndef MLPACK_METHODS_AMF_INIT_RULES_GIVEN_INIT_HPP 14 #define MLPACK_METHODS_AMF_INIT_RULES_GIVEN_INIT_HPP 51 template<
typename MatType>
58 if (w.n_rows != V.n_rows)
60 Log::Fatal <<
"The number of rows in given W (" << w.n_rows
61 <<
") doesn't equal the number of rows in V (" << V.n_rows
62 <<
") !" << std::endl;
66 Log::Fatal <<
"The number of columns in given W (" << w.n_cols
67 <<
") doesn't equal the rank of factorization (" << r
68 <<
") !" << std::endl;
70 if (h.n_cols != V.n_cols)
72 Log::Fatal <<
"The number of columns in given H (" << h.n_cols
73 <<
") doesn't equal the number of columns in V (" << V.n_cols
74 <<
") !" << std::endl;
78 Log::Fatal <<
"The number of rows in given H (" << h.n_rows
79 <<
") doesn't equal the rank of factorization (" << r
89 template<
typename Archive>
92 ar & BOOST_SERIALIZATION_NVP(w);
93 ar & BOOST_SERIALIZATION_NVP(h);
The core includes that mlpack expects; standard C++ includes and Armadillo.
static MLPACK_EXPORT util::PrefixedOutStream Fatal
Prints fatal messages prefixed with [FATAL], then terminates the program.
This initialization rule for AMF simply fills the W and H matrices with the matrices given to the con...
void Initialize(const MatType &V, const size_t r, arma::mat &W, arma::mat &H)
Fill W and H with random uniform noise.
GivenInitialization(const arma::mat &&w, const arma::mat &&h)
GivenInitialization(const arma::mat &w, const arma::mat &h)
void serialize(Archive &ar, const unsigned int)
Serialize the object (in this case, there is nothing to serialize).