- refactored
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@752 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+7
-3
@@ -73,13 +73,17 @@ Json::Value Rbm::toJson() const
|
||||
|
||||
void Rbm::weightUpdate(arma::mat const &v_states, arma::mat &dw, arma::mat &dbh, arma::mat &dbv)
|
||||
{
|
||||
arma::mat h_probs = prob(v_to_h(v_states));
|
||||
arma::mat v_probs(dbv.n_rows, dbv.n_cols);
|
||||
|
||||
arma::mat h_states = h_probs;
|
||||
arma::mat h_states = v_to_h(v_states);
|
||||
arma::mat h_probs = prob(h_states);
|
||||
|
||||
// Sample hidden
|
||||
if (!m_params.doRaoBlackwell)
|
||||
if (m_params.doRaoBlackwell)
|
||||
{
|
||||
h_states = h_probs;
|
||||
}
|
||||
else
|
||||
{
|
||||
h_states = sample(h_probs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user