From 0e544c1afc387d490470dead04b3d631859854c1 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Thu, 24 Oct 2019 18:54:40 +0000 Subject: [PATCH] - changed parameter order of train() git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@571 b431acfa-c32f-4a4a-93f1-934dc6c82436 --- source/Rbm.cpp | 2 +- source/Rbm.hpp | 2 +- source/main.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Rbm.cpp b/source/Rbm.cpp index 9dbd12c..b38cd6e 100644 --- a/source/Rbm.cpp +++ b/source/Rbm.cpp @@ -38,7 +38,7 @@ Rbm::~Rbm() { } -void Rbm::train(const arma::mat& batch, size_t numEpochs, size_t miniBatchSize, IListener* pListener) +void Rbm::train(const arma::mat& batch, size_t miniBatchSize, size_t numEpochs, IListener* pListener) { size_t epoch; size_t gibbs; diff --git a/source/Rbm.hpp b/source/Rbm.hpp index 4fabaac..bbf5afa 100644 --- a/source/Rbm.hpp +++ b/source/Rbm.hpp @@ -74,7 +74,7 @@ public: Rbm(const Rbm& orig); virtual ~Rbm(); - void train(arma::mat const &batch, size_t numEpochs, size_t sizeMiniBatch, IListener *pListener); + void train(arma::mat const &batch, size_t miniBatchSize, size_t numEpochs, IListener *pListener); arma::mat toHiddenState(const arma::mat &visible); arma::mat toVisibleState(const arma::mat &hidden); diff --git a/source/main.cpp b/source/main.cpp index d20a1b8..3b7d971 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -120,7 +120,7 @@ int main() arma::mat bv = arma::zeros(1, numVisible); arma::mat bh = arma::zeros(1, numHidden); Rbm rbm(params, w, bv, bh); - rbm.train(batch, 100, 100, &statusDisplay); + rbm.train(batch, 1000, 100, &statusDisplay); saveWeight("mnist_2.weights.dat", 28, 28, w, bv, bh); arma::mat v = arma::randu(numTraining, numVisible); arma::mat h = rbm.toHiddenProbs(v);