- GUI: added gaussian hidden, added mini batch size
- Rbm: added mini batch training revised sample functions, reverted to old weight decay


git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@305 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2016-07-07 19:27:33 +00:00
parent 4979ab41b4
commit 57cdfd7065
4 changed files with 161 additions and 87 deletions
+47 -6
View File
@@ -277,6 +277,20 @@ MainComponent::MainComponent ()
rbmDoSampleBatch->setButtonText (TRANS("Sample training"));
rbmDoSampleBatch->addListener (this);
addAndMakeVisible (sizeMiniBatch = new Label ("sizeMiniBatch",
TRANS("0")));
sizeMiniBatch->setTooltip (TRANS("Maximum number of training samples per train"));
sizeMiniBatch->setFont (Font (15.00f, Font::plain));
sizeMiniBatch->setJustificationType (Justification::centred);
sizeMiniBatch->setEditable (true, true, false);
sizeMiniBatch->setColour (TextEditor::textColourId, Colours::black);
sizeMiniBatch->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
sizeMiniBatch->addListener (this);
addAndMakeVisible (rbmUseHiddenGaussianToggleButton = new ToggleButton ("rbmUseHiddenGaussian toggle button"));
rbmUseHiddenGaussianToggleButton->setButtonText (TRANS("Use gaussian hidden"));
rbmUseHiddenGaussianToggleButton->addListener (this);
//[UserPreSize]
memset(m_pRbmComponent, 0, sizeof(m_pRbmComponent));
@@ -334,6 +348,8 @@ MainComponent::~MainComponent()
rbmNormalizeDataToggleButton = nullptr;
m_rbmSelect = nullptr;
rbmDoSampleBatch = nullptr;
sizeMiniBatch = nullptr;
rbmUseHiddenGaussianToggleButton = nullptr;
//[Destructor]. You can add your own custom destruction code here..
@@ -443,14 +459,16 @@ void MainComponent::resized()
sparsityLabel->setBounds (740, 152, 72, 24);
sigmaDecayLabel->setBounds (836, 152, 72, 24);
weightDecayLabel->setBounds (836, 200, 72, 24);
m_progressBarSlider->setBounds (844, 20, 220, 24);
m_progressBarSlider->setBounds (828, 20, 220, 24);
momentumLabel->setBounds (740, 200, 72, 24);
sparsityLearningRateLabel->setBounds (948, 152, 72, 24);
weightInitLabel->setBounds (948, 200, 72, 24);
rbmLearnVarianceButton->setBounds (976, 92, 128, 24);
rbmNormalizeDataToggleButton->setBounds (844, 92, 124, 24);
rbmLearnVarianceButton->setBounds (1004, 92, 128, 24);
rbmNormalizeDataToggleButton->setBounds (1004, 60, 124, 24);
m_rbmSelect->setBounds (812, 280, 62, 24);
rbmDoSampleBatch->setBounds (844, 60, 128, 24);
sizeMiniBatch->setBounds (1064, 20, 48, 24);
rbmUseHiddenGaussianToggleButton->setBounds (840, 92, 156, 24);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
@@ -575,6 +593,12 @@ void MainComponent::buttonClicked (Button* buttonThatWasClicked)
m_pRbmComponentCurr->setDoSampleBatch(buttonThatWasClicked->getToggleState());
//[/UserButtonCode_rbmDoSampleBatch]
}
else if (buttonThatWasClicked == rbmUseHiddenGaussianToggleButton)
{
//[UserButtonCode_rbmUseHiddenGaussianToggleButton] -- add your button handler code here..
m_pRbmComponentCurr->setUseHiddenGaussian(buttonThatWasClicked->getToggleState());
//[/UserButtonCode_rbmUseHiddenGaussianToggleButton]
}
//[UserbuttonClicked_Post]
//[/UserbuttonClicked_Post]
@@ -697,6 +721,12 @@ void MainComponent::labelTextChanged (Label* labelThatHasChanged)
//[UserLabelCode_weightInitLabel] -- add your label text handling code here..
//[/UserLabelCode_weightInitLabel]
}
else if (labelThatHasChanged == sizeMiniBatch)
{
//[UserLabelCode_sizeMiniBatch] -- add your label text handling code here..
m_pRbmComponentCurr->setMiniBatchSize((size_t)labelThatHasChanged->getText().getFloatValue());
//[/UserLabelCode_sizeMiniBatch]
}
//[UserlabelTextChanged_Post]
//[/UserlabelTextChanged_Post]
@@ -867,6 +897,7 @@ void MainComponent::updateControls()
rbmDoSampleVisibleToggleButton->setToggleState(m_pRbmComponentCurr->params().m_doSampleVisible, dontSendNotification);
rbmDoSampleBatch->setToggleState(m_pRbmComponentCurr->params().m_doSampleBatch, dontSendNotification);
rbmUseVisibleGaussianToggleButton->setToggleState(m_pRbmComponentCurr->params().m_useVisibleGaussian, dontSendNotification);
rbmUseHiddenGaussianToggleButton->setToggleState(m_pRbmComponentCurr->params().m_useHiddenGaussian, dontSendNotification);
rbmDoSparseToggleButton->setToggleState(m_pRbmComponentCurr->params().m_doSparse, dontSendNotification);
rbmLearnVarianceButton->setToggleState(m_pRbmComponentCurr->params().m_doLearnVariance, dontSendNotification);
rbmDoSampleBatch->setToggleState(m_pRbmComponentCurr->params().m_doSampleBatch, dontSendNotification);
@@ -882,6 +913,7 @@ 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);
@@ -1054,7 +1086,7 @@ BEGIN_JUCER_METADATA
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
bold="0" italic="0" justification="36"/>
<SLIDER name="progressBar slider" id="8c8748f39f6d0ec6" memberName="m_progressBarSlider"
virtualName="" explicitFocusOrder="0" pos="844 20 220 24" tooltip="Progress"
virtualName="" explicitFocusOrder="0" pos="828 20 220 24" tooltip="Progress"
min="0" max="100" int="1" style="LinearBar" textBoxPos="TextBoxLeft"
textBoxEditable="0" textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
<LABEL name="Momentum label" id="570ca1355ccd4cdd" memberName="momentumLabel"
@@ -1073,10 +1105,10 @@ BEGIN_JUCER_METADATA
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
bold="0" italic="0" justification="36"/>
<TOGGLEBUTTON name="rbmLearnVariance button" id="92c647c1f8b110a2" memberName="rbmLearnVarianceButton"
virtualName="" explicitFocusOrder="0" pos="976 92 128 24" buttonText="Learn Variance"
virtualName="" explicitFocusOrder="0" pos="1004 92 128 24" buttonText="Learn Variance"
connectedEdges="0" needsCallback="1" radioGroupId="0" state="0"/>
<TOGGLEBUTTON name="rbmNormalizeData toggle button" id="739772af1b096120" memberName="rbmNormalizeDataToggleButton"
virtualName="" explicitFocusOrder="0" pos="844 92 124 24" buttonText="Normalize data"
virtualName="" explicitFocusOrder="0" pos="1004 60 124 24" buttonText="Normalize data"
connectedEdges="0" needsCallback="1" radioGroupId="0" state="0"/>
<COMBOBOX name="RBM Selector" id="71115a4f965bfd38" memberName="m_rbmSelect"
virtualName="" explicitFocusOrder="0" pos="812 280 62 24" editable="0"
@@ -1085,6 +1117,15 @@ BEGIN_JUCER_METADATA
virtualName="" explicitFocusOrder="0" pos="844 60 128 24" tooltip="Sample training data during learning&#10;"
buttonText="Sample training" connectedEdges="0" needsCallback="1"
radioGroupId="0" state="0"/>
<LABEL name="sizeMiniBatch" id="dd9e3e6f2b7b22f8" memberName="sizeMiniBatch"
virtualName="" explicitFocusOrder="0" pos="1064 20 48 24" tooltip="Maximum number of training samples per train"
edTextCol="ff000000" edBkgCol="0" labelText="0" editableSingleClick="1"
editableDoubleClick="1" focusDiscardsChanges="0" fontname="Default font"
fontsize="15" bold="0" italic="0" justification="36"/>
<TOGGLEBUTTON name="rbmUseHiddenGaussian toggle button" id="92e05c920283616b"
memberName="rbmUseHiddenGaussianToggleButton" virtualName=""
explicitFocusOrder="0" pos="840 92 156 24" buttonText="Use gaussian hidden"
connectedEdges="0" needsCallback="1" radioGroupId="0" state="0"/>
</JUCER_COMPONENT>
END_JUCER_METADATA