- added Rbm

git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@560 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2019-10-21 21:28:26 +00:00
parent b4efb1d8f5
commit 6ad74f4ee7
5 changed files with 438 additions and 2 deletions
+11 -2
View File
@@ -1,6 +1,7 @@
#include <cstdio>
#include <cmath>
#include <armadillo>
#include "Rbm.hpp"
int main()
{
@@ -23,12 +24,20 @@ int main()
Pos.print("New position of the particle:"); // ^
// x (1,0)
// |
arma::mat Z = arma::eye<arma::mat>(4,4);
Z.print("Z:");
arma::mat Z = arma::eye<arma::mat>(4000,4000);
// Z.print("Z:");
printf("Z.n_rows = %d\n", (int)Z.n_rows);
printf("Z.n_cols = %d\n", (int)Z.n_cols);
printf("Z.n_elem = %d\n", (int)Z.n_elem);
// +------>
Rbm::Params params;
Rbm rbm(28*28, 64);
arma::mat batch = arma::randu(1000, 28*28);
rbm.train(batch, 1000, 100, params, nullptr);
// arma::mat v = arma::randu(28*28, 1);
// arma::mat h = rbm.toHidden(v);
// arma::mat r = rbm.toVisible(h);
return 0;
}