- added button copy hidden state to context input
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@766 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+13
-1
@@ -54,6 +54,12 @@ RbmComponent::RbmComponent (const std::string &name, size_t id, size_t numVisibl
|
|||||||
m_toggleEnable->setButtonText (TRANS("Enable"));
|
m_toggleEnable->setButtonText (TRANS("Enable"));
|
||||||
m_toggleEnable->addListener (this);
|
m_toggleEnable->addListener (this);
|
||||||
m_toggleEnable->setToggleState(true, NotificationType::dontSendNotification);
|
m_toggleEnable->setToggleState(true, NotificationType::dontSendNotification);
|
||||||
|
|
||||||
|
addAndMakeVisible (m_buttonCopyH2C = new TextButton ("Copy hidden state to context"));
|
||||||
|
m_buttonCopyH2C->setTooltip (TRANS("Copy hidden state to context input"));
|
||||||
|
m_buttonCopyH2C->setButtonText (TRANS("H2C"));
|
||||||
|
m_buttonCopyH2C->addListener (this);
|
||||||
|
|
||||||
redrawWeights();
|
redrawWeights();
|
||||||
|
|
||||||
setSize (m_sizeX, m_sizeY);
|
setSize (m_sizeX, m_sizeY);
|
||||||
@@ -69,6 +75,7 @@ RbmComponent::~RbmComponent()
|
|||||||
DrawHidden = nullptr;
|
DrawHidden = nullptr;
|
||||||
DrawContextTrain = nullptr;
|
DrawContextTrain = nullptr;
|
||||||
DrawContextReconst = nullptr;
|
DrawContextReconst = nullptr;
|
||||||
|
m_buttonCopyH2C = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
@@ -147,6 +154,7 @@ void RbmComponent::resized()
|
|||||||
DrawContextReconst->setBoundsRelative (0, 140./m_sizeY, 430./m_sizeX, 20./m_sizeY);
|
DrawContextReconst->setBoundsRelative (0, 140./m_sizeY, 430./m_sizeX, 20./m_sizeY);
|
||||||
DrawHidden->setBoundsRelative (0, 170./m_sizeY, 430./m_sizeX, 20./m_sizeY);
|
DrawHidden->setBoundsRelative (0, 170./m_sizeY, 430./m_sizeX, 20./m_sizeY);
|
||||||
m_toggleEnable->setBoundsRelative (330./m_sizeX, 0, 80./m_sizeX, 24./m_sizeY);
|
m_toggleEnable->setBoundsRelative (330./m_sizeX, 0, 80./m_sizeX, 24./m_sizeY);
|
||||||
|
m_buttonCopyH2C->setBoundsRelative (330./m_sizeX, 30./m_sizeY, 80./m_sizeX, 24./m_sizeY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RbmComponent::mouseMove (const MouseEvent& e)
|
void RbmComponent::mouseMove (const MouseEvent& e)
|
||||||
@@ -237,6 +245,11 @@ void RbmComponent::buttonClicked(Button* buttonThatWasClicked)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
redrawReconstruction();
|
redrawReconstruction();
|
||||||
|
}
|
||||||
|
else if (buttonThatWasClicked == m_buttonCopyH2C)
|
||||||
|
{
|
||||||
|
DrawContextTrain->getData() = DrawHidden->getData();
|
||||||
|
upDownPass(getTraining());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +257,6 @@ void RbmComponent::redrawReconstruction()
|
|||||||
{
|
{
|
||||||
RbmComponent *pComp = static_cast<RbmComponent*> (root());
|
RbmComponent *pComp = static_cast<RbmComponent*> (root());
|
||||||
pComp->upDownPass(pComp->getTraining());
|
pComp->upDownPass(pComp->getTraining());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RbmComponent::gibbs(const arma::mat& vc)
|
void RbmComponent::gibbs(const arma::mat& vc)
|
||||||
|
|||||||
@@ -84,6 +84,8 @@ private:
|
|||||||
ScopedPointer<DrawComponent> DrawContextReconst;
|
ScopedPointer<DrawComponent> DrawContextReconst;
|
||||||
ScopedPointer<DrawComponent> DrawWeights;
|
ScopedPointer<DrawComponent> DrawWeights;
|
||||||
ScopedPointer<ToggleButton> m_toggleEnable;
|
ScopedPointer<ToggleButton> m_toggleEnable;
|
||||||
|
ScopedPointer<TextButton> m_buttonCopyH2C;
|
||||||
|
|
||||||
void gibbs(const arma::mat& v);
|
void gibbs(const arma::mat& v);
|
||||||
size_t m_currWeightIndexToDraw;
|
size_t m_currWeightIndexToDraw;
|
||||||
void onDraw(DrawComponent &obj) override;
|
void onDraw(DrawComponent &obj) override;
|
||||||
|
|||||||
Reference in New Issue
Block a user