- added weight init std dev on GUI
git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@34 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+1
-1
@@ -26,8 +26,8 @@ public:
|
||||
, m_probs(numUnits)
|
||||
, m_states(numUnits)
|
||||
{
|
||||
setNumUnits(numUnits);
|
||||
Noise_Init(&m_noise, 0x12345677);
|
||||
setNumUnits(numUnits);
|
||||
|
||||
if (pStatesInit && (pStatesInit->size() == numUnits))
|
||||
{
|
||||
|
||||
@@ -271,6 +271,15 @@ MainComponent::MainComponent ()
|
||||
sparsityLearningRateLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
|
||||
sparsityLearningRateLabel->addListener (this);
|
||||
|
||||
addAndMakeVisible (weightInitLabel = new Label ("WeightInit label",
|
||||
TRANS("0.001")));
|
||||
weightInitLabel->setFont (Font (15.00f, Font::plain));
|
||||
weightInitLabel->setJustificationType (Justification::centred);
|
||||
weightInitLabel->setEditable (true, true, false);
|
||||
weightInitLabel->setColour (TextEditor::textColourId, Colours::black);
|
||||
weightInitLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
|
||||
weightInitLabel->addListener (this);
|
||||
|
||||
|
||||
//[UserPreSize]
|
||||
m_vNumX = 16;
|
||||
@@ -329,6 +338,7 @@ MainComponent::~MainComponent()
|
||||
m_progressBarSlider = nullptr;
|
||||
momentumLabel = nullptr;
|
||||
sparsityLearningRateLabel = nullptr;
|
||||
weightInitLabel = nullptr;
|
||||
|
||||
|
||||
//[Destructor]. You can add your own custom destruction code here..
|
||||
@@ -403,6 +413,12 @@ void MainComponent::paint (Graphics& g)
|
||||
408, 306, 96, 14,
|
||||
Justification::centred, true);
|
||||
|
||||
g.setColour (Colours::black);
|
||||
g.setFont (Font (15.00f, Font::plain));
|
||||
g.drawText (TRANS("Weight init"),
|
||||
408, 354, 96, 14,
|
||||
Justification::centred, true);
|
||||
|
||||
//[UserPaint] Add your own custom painting code here..
|
||||
//[/UserPaint]
|
||||
}
|
||||
@@ -443,6 +459,7 @@ void MainComponent::resized()
|
||||
m_progressBarSlider->setBounds (216, 160, 184, 24);
|
||||
momentumLabel->setBounds (208, 368, 72, 24);
|
||||
sparsityLearningRateLabel->setBounds (416, 320, 72, 24);
|
||||
weightInitLabel->setBounds (416, 368, 72, 24);
|
||||
//[UserResized] Add your own custom resize handling here..
|
||||
DrawTraining->setBounds (16, 16, 100, 100);
|
||||
DrawReconstruction->setBounds (110+16, 16, 100, 100);
|
||||
@@ -482,7 +499,7 @@ void MainComponent::buttonClicked (Button* buttonThatWasClicked)
|
||||
else if (buttonThatWasClicked == ShakeButton)
|
||||
{
|
||||
//[UserButtonCode_ShakeButton] -- add your button handler code here..
|
||||
m_weights.shuffle(0.001);
|
||||
m_weights.shuffle(weightInitLabel->getText().getFloatValue());
|
||||
redrawReconstruction();
|
||||
redrawWeights((int)WeightsSlider->getValue());
|
||||
//[/UserButtonCode_ShakeButton]
|
||||
@@ -726,6 +743,11 @@ void MainComponent::labelTextChanged (Label* labelThatHasChanged)
|
||||
m_pRbm->setMuSparsity(labelThatHasChanged->getText().getFloatValue());
|
||||
//[/UserLabelCode_sparsityLearningRateLabel]
|
||||
}
|
||||
else if (labelThatHasChanged == weightInitLabel)
|
||||
{
|
||||
//[UserLabelCode_weightInitLabel] -- add your label text handling code here..
|
||||
//[/UserLabelCode_weightInitLabel]
|
||||
}
|
||||
|
||||
//[UserlabelTextChanged_Post]
|
||||
//[/UserlabelTextChanged_Post]
|
||||
@@ -770,7 +792,7 @@ void MainComponent::create()
|
||||
|
||||
m_pRbm = new Rbm(m_weights, this);
|
||||
sigma_gauss = 0.5;
|
||||
sigmaDecay_gauss = 0.99;
|
||||
sigmaDecay_gauss = 1.0;
|
||||
m_pRbm->setDoRaoBlackwell(rbmDoRaoBlackwellToggleButton->getToggleState());
|
||||
m_pRbm->setUseProbsForHiddenReconstruction(rbmReduceVarianceToggleButton->getToggleState());
|
||||
m_pRbm->setUseVisibleGaussian(rbmUseVisibleGaussianToggleButton->getToggleState());
|
||||
@@ -898,6 +920,8 @@ BEGIN_JUCER_METADATA
|
||||
fontname="Default font" fontsize="15" bold="0" italic="0" justification="36"/>
|
||||
<TEXT pos="408 306 96 14" fill="solid: ff000000" hasStroke="0" text="Sparsity Alpha"
|
||||
fontname="Default font" fontsize="15" bold="0" italic="0" justification="36"/>
|
||||
<TEXT pos="408 354 96 14" fill="solid: ff000000" hasStroke="0" text="Weight init"
|
||||
fontname="Default font" fontsize="15" bold="0" italic="0" justification="36"/>
|
||||
</BACKGROUND>
|
||||
<TEXTBUTTON name="Train button" id="7909d74b5522987c" memberName="trainButton"
|
||||
virtualName="" explicitFocusOrder="0" pos="120 408 72 24" buttonText="Train"
|
||||
@@ -1034,6 +1058,11 @@ BEGIN_JUCER_METADATA
|
||||
edBkgCol="0" labelText="0.01" editableSingleClick="1" editableDoubleClick="1"
|
||||
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
|
||||
bold="0" italic="0" justification="36"/>
|
||||
<LABEL name="WeightInit label" id="c827025f2cc51ddf" memberName="weightInitLabel"
|
||||
virtualName="" explicitFocusOrder="0" pos="416 368 72 24" edTextCol="ff000000"
|
||||
edBkgCol="0" labelText="0.001" editableSingleClick="1" editableDoubleClick="1"
|
||||
focusDiscardsChanges="0" fontname="Default font" fontsize="15"
|
||||
bold="0" italic="0" justification="36"/>
|
||||
</JUCER_COMPONENT>
|
||||
|
||||
END_JUCER_METADATA
|
||||
|
||||
@@ -128,6 +128,7 @@ private:
|
||||
ScopedPointer<Slider> m_progressBarSlider;
|
||||
ScopedPointer<Label> momentumLabel;
|
||||
ScopedPointer<Label> sparsityLearningRateLabel;
|
||||
ScopedPointer<Label> weightInitLabel;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
||||
@@ -26,6 +26,7 @@ public:
|
||||
: m_numVisible(0)
|
||||
, m_numHidden(0)
|
||||
{
|
||||
Noise_Init(&m_noise, 0x32727155);
|
||||
load(pFilename);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user