- added rms_error function
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@786 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -170,6 +170,18 @@ public:
|
||||
arma::mat v_to_h(const arma::mat &visible) const;
|
||||
arma::mat h_to_v(const arma::mat &hidden) const;
|
||||
|
||||
static double rms_error_accu(arma::mat diffErr)
|
||||
{
|
||||
arma::mat diffErr_squared = diffErr % diffErr;
|
||||
return arma::accu(diffErr_squared)/diffErr_squared.n_elem;
|
||||
}
|
||||
|
||||
static arma::mat rms_error(arma::mat diffErr)
|
||||
{
|
||||
arma::mat diffErr_squared = diffErr % diffErr;
|
||||
return arma::sum(diffErr_squared, 1) * 1.0/diffErr_squared.n_cols;
|
||||
}
|
||||
|
||||
private:
|
||||
Params m_params;
|
||||
arma::mat sample(arma::mat const &src);
|
||||
|
||||
Reference in New Issue
Block a user