- weights and biases are allocated outside Rbm

git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@565 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2019-10-22 06:30:21 +00:00
parent 675a5485fe
commit de33b3ecbd
3 changed files with 22 additions and 13 deletions
+5 -2
View File
@@ -54,11 +54,14 @@ int main()
RbmListener statusDisplay;
Rbm::Params params;
Rbm rbm(28*28, 64);
arma::mat w = arma::zeros(28*28, 64);
arma::mat bv = arma::zeros(1, 28*28);
arma::mat bh = arma::zeros(1, 64);
Rbm rbm(w, bv, bh);
arma::mat batch = arma::randu(100, 28*28);
rbm.train(batch, 10, 10, params, &statusDisplay);
arma::mat v = arma::randu(10, 28*28);
arma::mat v = arma::randu(100, 28*28);
arma::mat h = rbm.toHidden(v);
arma::mat r = rbm.toVisible(h);
return 0;