- fixed crashes
This commit is contained in:
@@ -816,6 +816,7 @@ void MainComponent::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
|
|||||||
{
|
{
|
||||||
int index = m_rbmSelect->getSelectedItemIndex();
|
int index = m_rbmSelect->getSelectedItemIndex();
|
||||||
m_pLayer = static_cast<RbmComponent*>(m_stack->getLayer(index));
|
m_pLayer = static_cast<RbmComponent*>(m_stack->getLayer(index));
|
||||||
|
m_weightIndex = 0;
|
||||||
updateControls();
|
updateControls();
|
||||||
m_pLayer->redrawWeights(m_weightIndex);
|
m_pLayer->redrawWeights(m_weightIndex);
|
||||||
if (m_stack->trainingBatch().n_rows > 0)
|
if (m_stack->trainingBatch().n_rows > 0)
|
||||||
|
|||||||
@@ -56,11 +56,15 @@ RbmComponent::RbmComponent (DeepStack &stack, const std::string &name, size_t id
|
|||||||
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"));
|
addChildComponent (m_buttonCopyH2C = new TextButton ("Copy hidden state to context"));
|
||||||
m_buttonCopyH2C->setTooltip (TRANS("Copy hidden state to context input"));
|
m_buttonCopyH2C->setTooltip (TRANS("Copy hidden state to context input"));
|
||||||
m_buttonCopyH2C->setButtonText (TRANS("H2C"));
|
m_buttonCopyH2C->setButtonText (TRANS("H2C"));
|
||||||
m_buttonCopyH2C->addListener (this);
|
m_buttonCopyH2C->addListener (this);
|
||||||
|
|
||||||
|
if (m_numContext)
|
||||||
|
{
|
||||||
|
m_buttonCopyH2C->setVisible(true);
|
||||||
|
}
|
||||||
redrawWeights();
|
redrawWeights();
|
||||||
|
|
||||||
setSize (m_sizeX, m_sizeY);
|
setSize (m_sizeX, m_sizeY);
|
||||||
@@ -250,11 +254,14 @@ void RbmComponent::buttonClicked(Button* buttonThatWasClicked)
|
|||||||
redrawReconstruction();
|
redrawReconstruction();
|
||||||
}
|
}
|
||||||
else if (buttonThatWasClicked == m_buttonCopyH2C)
|
else if (buttonThatWasClicked == m_buttonCopyH2C)
|
||||||
|
{
|
||||||
|
if (m_numContext)
|
||||||
{
|
{
|
||||||
DrawContextTrain->getData() = DrawHidden->getData();
|
DrawContextTrain->getData() = DrawHidden->getData();
|
||||||
m_stack.upDownPass(id(), getTraining());
|
m_stack.upDownPass(id(), getTraining());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RbmComponent::redrawReconstruction()
|
void RbmComponent::redrawReconstruction()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user