MLPACK  1.0.8
mult_dist_update_rules.hpp
Go to the documentation of this file.
1 
27 #ifndef __MLPACK_METHODS_NMF_MULT_DIST_UPDATE_RULES_HPP
28 #define __MLPACK_METHODS_NMF_MULT_DIST_UPDATE_RULES_HPP
29 
30 #include <mlpack/core.hpp>
31 
32 namespace mlpack {
33 namespace nmf {
34 
42 {
43  public:
44  // Empty constructor required for the WUpdateRule template.
46 
55  template<typename MatType>
56  inline static void Update(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 };
63 
71 {
72  public:
73  // Empty constructor required for the HUpdateRule template.
75 
84  template<typename MatType>
85  inline static void Update(const MatType& V,
86  const arma::mat& W,
87  arma::mat& H)
88  {
89  H = (H % (W.t() * V)) / (W.t() * W * H);
90  }
91 };
92 
93 }; // namespace nmf
94 }; // namespace mlpack
95 
96 #endif