3 #ifndef NTF_NTFHALS_HPP_ 4 #define NTF_NTFHALS_HPP_ 13 MAT update(
const int mode) {
14 MAT H(this->m_ncp_factors.factor(mode));
16 for (
int i = 0; i < this->m_ncp_factors.rank(); i++) {
18 H.col(i) + ((this->ncp_mttkrp_t[mode].row(i)).t() -
19 H * this->gram_without_one.col(i));
20 fixNumericalError<VEC>(&updHi);
21 double normHi = arma::norm(updHi, 2);
23 double globalnormHi = normHi;
24 if (globalnormHi > 0) {
33 :
AUNTF(i_tensor, i_k, i_algo) {}
38 #endif // NTF_NTFHALS_HPP_
Data is stored such that the unfolding is column major.
NTFHALS(const Tensor &i_tensor, const int i_k, algotype i_algo)
ncp_factors contains the factors of the ncp every ith factor is of size n_i * k number of factors is ...