MLPACK
1.0.7
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
mlpack
methods
nmf
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
41
class
WMultiplicativeDistanceRule
42
{
43
public
:
44
// Empty constructor required for the WUpdateRule template.
45
WMultiplicativeDistanceRule
() { }
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
70
class
HMultiplicativeDistanceRule
71
{
72
public
:
73
// Empty constructor required for the HUpdateRule template.
74
HMultiplicativeDistanceRule
() { }
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
Generated by
1.8.3.1