- correct energy calc. for BB-RBMs
git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@39 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+3
-6
@@ -124,8 +124,6 @@ public:
|
||||
return m_numUnits;
|
||||
}
|
||||
|
||||
virtual double getEnergy(const Weights &weights) = 0;
|
||||
|
||||
private:
|
||||
noise_gen_t m_noise;
|
||||
|
||||
@@ -145,17 +143,16 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void gaussProb(const VectorXd &x, double sigma)
|
||||
void gaussProb(const VectorXd &mu, double sigma)
|
||||
{
|
||||
uint32_t i;
|
||||
double var = sigma*sigma;
|
||||
double k = 1.0/sqrt(2*3.14159265359*var);
|
||||
double mu = 0;
|
||||
|
||||
for (i=0; i < m_numUnits; i++)
|
||||
{
|
||||
double x2 = ((double)x[i]-mu);
|
||||
m_probs[i] = 1-exp(-x2*x2/(2*var));
|
||||
double x2 = (1-(double)mu[i]);
|
||||
m_probs[i] = k*exp(-0.5*x2*x2/var);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user