25 void allocateMatrices() {
26 WtW = arma::zeros<MAT>(this->k, this->k);
27 HtH = arma::zeros<MAT>(this->k, this->k);
28 AtW = arma::zeros<MAT>(this->n, this->k);
29 AH = arma::zeros<MAT>(this->m, this->k);
40 MUNMF(
const T &A,
int lowrank) :
NMF<T>(A, lowrank) {
42 this->At = this->A.t();
46 this->At = this->A.t();
49 unsigned int currentIteration = 0;
55 AtW = this->At * this->W;
56 WtW = this->W.t() * this->W;
57 INFO <<
"starting H Prereq for " 64 INFO <<
"Completed H (" << currentIteration <<
"/" 66 <<
" time =" <<
toc() << std::endl;
70 AH = this->A * this->H;
71 HtH = this->H.t() * this->H;
72 INFO <<
"starting W Prereq for " 78 INFO <<
"Completed W (" << currentIteration <<
"/" 80 <<
" time =" <<
toc() << std::endl;
81 INFO <<
"Completed It (" << currentIteration <<
"/" 83 <<
" time =" <<
toc() << std::endl;
85 INFO <<
"Completed it = " << currentIteration
86 <<
" MUERR=" << sqrt(this->objective_err) / this->normA << std::endl;
89 this->normalize_by_W();
MUNMF(const T &A, int lowrank)
void tic()
start the timer. easy to call as tic(); some code; double t=toc();
#define EPSILON_1EMINUS16
const unsigned int num_iterations() const
Returns the number of iterations.
MUNMF(const T &A, const MAT &llf, const MAT &rlf)
ncp_factors contains the factors of the ncp every ith factor is of size n_i * k number of factors is ...
void computeObjectiveError()