mlpack  1.0.12
nmf_mult_dist.hpp
Go to the documentation of this file.
1 
14 #ifndef __MLPACK_METHODS_LMF_UPDATE_RULES_NMF_MULT_DIST_UPDATE_RULES_HPP
15 #define __MLPACK_METHODS_LMF_UPDATE_RULES_NMF_MULT_DIST_UPDATE_RULES_HPP
16 
17 #include <mlpack/core.hpp>
18 
19 namespace mlpack {
20 namespace amf {
21 
31 {
32  public:
33  // Empty constructor required for the UpdateRule template.
35 
36  template<typename MatType>
37  void Initialize(const MatType& dataset, const size_t rank)
38  {
39  (void)dataset;
40  (void)rank;
41  }
42 
55  template<typename MatType>
56  inline static void WUpdate(const MatType& V,
57  arma::mat& W,
58  const arma::mat& H)
59  {
60  W = (W % (V * H.t())) / (W * H * H.t());
61  }
62 
75  template<typename MatType>
76  inline static void HUpdate(const MatType& V,
77  const arma::mat& W,
78  arma::mat& H)
79  {
80  H = (H % (W.t() * V)) / (W.t() * W * H);
81  }
82 };
83 
84 }; // namespace amf
85 }; // namespace mlpack
86 
87 #endif
static void HUpdate(const MatType &V, const arma::mat &W, arma::mat &H)
The update rule for the encoding matrix H.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:23
static void WUpdate(const MatType &V, arma::mat &W, const arma::mat &H)
The update rule for the basis matrix W.
void Initialize(const MatType &dataset, const size_t rank)
The multiplicative distance update rules for matrices W and H.