- fixed crashes

This commit is contained in:
2024-01-21 14:10:37 +01:00
parent 46ded370f6
commit 3e819d32a8
2 changed files with 11 additions and 3 deletions
+1
View File
@@ -816,6 +816,7 @@ void MainComponent::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
{
int index = m_rbmSelect->getSelectedItemIndex();
m_pLayer = static_cast<RbmComponent*>(m_stack->getLayer(index));
m_weightIndex = 0;
updateControls();
m_pLayer->redrawWeights(m_weightIndex);
if (m_stack->trainingBatch().n_rows > 0)
+10 -3
View File
@@ -56,11 +56,15 @@ RbmComponent::RbmComponent (DeepStack &stack, const std::string &name, size_t id
m_toggleEnable->addListener (this);
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->setButtonText (TRANS("H2C"));
m_buttonCopyH2C->addListener (this);
if (m_numContext)
{
m_buttonCopyH2C->setVisible(true);
}
redrawWeights();
setSize (m_sizeX, m_sizeY);
@@ -251,8 +255,11 @@ void RbmComponent::buttonClicked(Button* buttonThatWasClicked)
}
else if (buttonThatWasClicked == m_buttonCopyH2C)
{
DrawContextTrain->getData() = DrawHidden->getData();
m_stack.upDownPass(id(), getTraining());
if (m_numContext)
{
DrawContextTrain->getData() = DrawHidden->getData();
m_stack.upDownPass(id(), getTraining());
}
}
}