- added addTraining pattern
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@626 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -498,7 +498,8 @@ void MainComponent::buttonClicked (Button* buttonThatWasClicked)
|
|||||||
else if (buttonThatWasClicked == addButton)
|
else if (buttonThatWasClicked == addButton)
|
||||||
{
|
{
|
||||||
//[UserButtonCode_addButton] -- add your button handler code here..
|
//[UserButtonCode_addButton] -- add your button handler code here..
|
||||||
// m_layers.add(m_pRbmComponent[0]->getTrainingData(), m_weights[0]->getNumVisible());
|
RbmComponent *pComp = static_cast<RbmComponent*>(m_stack->getLayer(0));
|
||||||
|
addTraining(pComp->DrawTraining->getData());
|
||||||
//[/UserButtonCode_addButton]
|
//[/UserButtonCode_addButton]
|
||||||
}
|
}
|
||||||
else if (buttonThatWasClicked == ShakeButton)
|
else if (buttonThatWasClicked == ShakeButton)
|
||||||
@@ -512,7 +513,16 @@ void MainComponent::buttonClicked (Button* buttonThatWasClicked)
|
|||||||
else if (buttonThatWasClicked == createButton)
|
else if (buttonThatWasClicked == createButton)
|
||||||
{
|
{
|
||||||
//[UserButtonCode_createButton] -- add your button handler code here..
|
//[UserButtonCode_createButton] -- add your button handler code here..
|
||||||
create("justCreated");
|
int numVisX = numVisibleLabel->getText().getIntValue();
|
||||||
|
int numVisY = numVisibleYLabel->getText().getIntValue();
|
||||||
|
int numHid = numHiddenLabel->getText().getIntValue();
|
||||||
|
m_stack = new Stack(std::string(projectNameLabel->getText().getCharPointer()));
|
||||||
|
m_stack->addLayer(onConstruct("Layer", 0, numVisX, numVisY, numHid));
|
||||||
|
m_rbmSelect->clear(dontSendNotification);
|
||||||
|
m_rbmSelect->addItem(String(0), 0+1);
|
||||||
|
m_rbmSelect->setSelectedId(1, sendNotification);
|
||||||
|
// addTraining(arma::zeros(1, numVisX*numVisY));
|
||||||
|
|
||||||
//[/UserButtonCode_createButton]
|
//[/UserButtonCode_createButton]
|
||||||
}
|
}
|
||||||
else if (buttonThatWasClicked == loadButton)
|
else if (buttonThatWasClicked == loadButton)
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public:
|
|||||||
{
|
{
|
||||||
RbmComponent *pComp = new RbmComponent(name, id, numVisibleX, numVisibleY, numHidden, this);
|
RbmComponent *pComp = new RbmComponent(name, id, numVisibleX, numVisibleY, numHidden, this);
|
||||||
addAndMakeVisible(pComp);
|
addAndMakeVisible(pComp);
|
||||||
return pComp;
|
return static_cast<Layer*>(pComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -134,11 +134,11 @@ public:
|
|||||||
arma::mat const& getTopWeights() override;
|
arma::mat const& getTopWeights() override;
|
||||||
arma::mat getConvolutedWeight(arma::mat const &h) override;
|
arma::mat getConvolutedWeight(arma::mat const &h) override;
|
||||||
arma::mat const& getWeights() override;
|
arma::mat const& getWeights() override;
|
||||||
|
ScopedPointer<DrawComponent> DrawTraining;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//[UserVariables] -- You can add your own custom variables in this section.
|
//[UserVariables] -- You can add your own custom variables in this section.
|
||||||
RbmComponentListener *m_listener;
|
RbmComponentListener *m_listener;
|
||||||
ScopedPointer<DrawComponent> DrawTraining;
|
|
||||||
ScopedPointer<DrawComponent> DrawReconstruction;
|
ScopedPointer<DrawComponent> DrawReconstruction;
|
||||||
ScopedPointer<DrawComponent> DrawWeights;
|
ScopedPointer<DrawComponent> DrawWeights;
|
||||||
ScopedPointer<DrawComponent> DrawHidden;
|
ScopedPointer<DrawComponent> DrawHidden;
|
||||||
|
|||||||
Reference in New Issue
Block a user