From 2eabaa42ec928398f85fd115ddc2f8c5bf8e482c Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Thu, 7 Jul 2016 23:34:03 +0000 Subject: [PATCH] [RBM] - miniBatchSize is parameter of train() git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@307 b431acfa-c32f-4a4a-93f1-934dc6c82436 --- Source/MainComponent.cpp | 14 +++++--------- Source/Rbm.cpp | 24 +++++++++--------------- Source/Rbm.hpp | 5 +---- 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/Source/MainComponent.cpp b/Source/MainComponent.cpp index c11825f..4cb0e62 100644 --- a/Source/MainComponent.cpp +++ b/Source/MainComponent.cpp @@ -278,8 +278,8 @@ MainComponent::MainComponent () rbmDoSampleBatch->addListener (this); addAndMakeVisible (sizeMiniBatch = new Label ("sizeMiniBatch", - TRANS("0"))); - sizeMiniBatch->setTooltip (TRANS("Maximum number of training samples per train")); + TRANS("100"))); + sizeMiniBatch->setTooltip (TRANS("Mini batch size")); sizeMiniBatch->setFont (Font (15.00f, Font::plain)); sizeMiniBatch->setJustificationType (Justification::centred); sizeMiniBatch->setEditable (true, true, false); @@ -724,7 +724,6 @@ void MainComponent::labelTextChanged (Label* labelThatHasChanged) else if (labelThatHasChanged == sizeMiniBatch) { //[UserLabelCode_sizeMiniBatch] -- add your label text handling code here.. - m_pRbmComponentCurr->setMiniBatchSize((size_t)labelThatHasChanged->getText().getFloatValue()); //[/UserLabelCode_sizeMiniBatch] } @@ -875,9 +874,7 @@ const juce::String& MainComponent::getBaseDir() void MainComponent::run() { -// trainButton->setEnabled(false); - m_pRbmComponentCurr->train(numEpochslabel->getText().getIntValue()); -// trainButton->setEnabled(true); + m_pRbmComponentCurr->train((size_t)numEpochslabel->getText().getIntValue(), (size_t)sizeMiniBatch->getText().getIntValue()); } void MainComponent::onChanged(const LayerArray &obj) @@ -913,7 +910,6 @@ void MainComponent::updateControls() numVisibleLabel->setText(String(m_weightsCurr->getNumVisibleX()), dontSendNotification ); numVisibleYLabel->setText(String(m_weightsCurr->getNumVisibleY()), dontSendNotification ); numHiddenLabel->setText(String(m_weightsCurr->getNumHidden()), dontSendNotification ); - sizeMiniBatch->setText(String(m_pRbmComponentCurr->params().m_miniBatchSize), dontSendNotification); WeightsSlider->setRange(0, m_weightsCurr->getNumHidden()-1, 1); numGibbsSlider->setValue(m_pRbmComponentCurr->params().m_numGibbs); @@ -1118,8 +1114,8 @@ BEGIN_JUCER_METADATA buttonText="Sample training" connectedEdges="0" needsCallback="1" radioGroupId="0" state="0"/>