From d0243820d6ce2ce75ef5f992348e577917b2bd87 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sun, 19 Oct 2014 14:58:24 +0000 Subject: [PATCH] - init weight with dev = 0.001 - layer load() plausibilty check git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@32 b431acfa-c32f-4a4a-93f1-934dc6c82436 --- Source/LayerArray.hpp | 3 +++ Source/MainComponent.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/LayerArray.hpp b/Source/LayerArray.hpp index 4fb4832..45218f0 100644 --- a/Source/LayerArray.hpp +++ b/Source/LayerArray.hpp @@ -205,6 +205,9 @@ public: { uint32_t numUnits; fscanf(pFile, "%d\n", &numUnits); + if (numUnits == 0) + break; + pData = new double[numUnits]; T* data = add(nullptr, numUnits); diff --git a/Source/MainComponent.cpp b/Source/MainComponent.cpp index 76cc9bc..a64fd08 100644 --- a/Source/MainComponent.cpp +++ b/Source/MainComponent.cpp @@ -482,7 +482,7 @@ void MainComponent::buttonClicked (Button* buttonThatWasClicked) else if (buttonThatWasClicked == ShakeButton) { //[UserButtonCode_ShakeButton] -- add your button handler code here.. - m_weights.shuffle(0.01); + m_weights.shuffle(0.001); redrawReconstruction(); redrawWeights((int)WeightsSlider->getValue()); //[/UserButtonCode_ShakeButton]