- 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:
2022-01-09 16:52:49 +00:00
parent 238a6d9258
commit 073e789fb6
2 changed files with 15 additions and 1 deletions
+13 -1
View File
@@ -54,6 +54,12 @@ RbmComponent::RbmComponent (const std::string &name, size_t id, size_t numVisibl
m_toggleEnable->setButtonText (TRANS("Enable"));
m_toggleEnable->addListener (this);
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();
setSize (m_sizeX, m_sizeY);
@@ -69,6 +75,7 @@ RbmComponent::~RbmComponent()
DrawHidden = nullptr;
DrawContextTrain = 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);
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_buttonCopyH2C->setBoundsRelative (330./m_sizeX, 30./m_sizeY, 80./m_sizeX, 24./m_sizeY);
}
void RbmComponent::mouseMove (const MouseEvent& e)
@@ -237,6 +245,11 @@ void RbmComponent::buttonClicked(Button* buttonThatWasClicked)
}
}
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());
pComp->upDownPass(pComp->getTraining());
}
void RbmComponent::gibbs(const arma::mat& vc)
+2
View File
@@ -84,6 +84,8 @@ private:
ScopedPointer<DrawComponent> DrawContextReconst;
ScopedPointer<DrawComponent> DrawWeights;
ScopedPointer<ToggleButton> m_toggleEnable;
ScopedPointer<TextButton> m_buttonCopyH2C;
void gibbs(const arma::mat& v);
size_t m_currWeightIndexToDraw;
void onDraw(DrawComponent &obj) override;