mult_dist_update_rules.hpp

Go to the documentation of this file.
00001 
00027 #ifndef __MLPACK_METHODS_NMF_MULT_DIST_UPDATE_RULES_HPP
00028 #define __MLPACK_METHODS_NMF_MULT_DIST_UPDATE_RULES_HPP
00029 
00030 #include <mlpack/core.hpp>
00031 
00032 namespace mlpack {
00033 namespace nmf {
00034 
00041 class WMultiplicativeDistanceRule
00042 {
00043  public:
00044   // Empty constructor required for the WUpdateRule template.
00045   WMultiplicativeDistanceRule() { }
00046 
00055   template<typename MatType>
00056   inline static void Update(const MatType& V,
00057                             arma::mat& W,
00058                             const arma::mat& H)
00059   {
00060     W = (W % (V * H.t())) / (W * H * H.t());
00061   }
00062 };
00063 
00070 class HMultiplicativeDistanceRule
00071 {
00072  public:
00073   // Empty constructor required for the HUpdateRule template.
00074   HMultiplicativeDistanceRule() { }
00075 
00084   template<typename MatType>
00085   inline static void Update(const MatType& V,
00086                             const arma::mat& W,
00087                             arma::mat& H)
00088   {
00089     H = (H % (W.t() * V)) / (W.t() * W * H);
00090   }
00091 };
00092 
00093 }; // namespace nmf
00094 }; // namespace mlpack
00095 
00096 #endif

Generated on 13 Aug 2014 for MLPACK by  doxygen 1.6.1