- fixed crash, when try to train without training patterns
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@664 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+4
-1
@@ -36,7 +36,10 @@ public:
|
||||
|
||||
void train(arma::mat const &batch, IListener *pListener=nullptr)
|
||||
{
|
||||
Rbm::train(trainingData(batch), pListener);
|
||||
if (batch.n_rows > 0)
|
||||
{
|
||||
Rbm::train(trainingData(batch), pListener);
|
||||
}
|
||||
}
|
||||
|
||||
std::string& name()
|
||||
|
||||
@@ -762,7 +762,10 @@ void MainComponent::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
|
||||
m_pLayer = static_cast<RbmComponent*>(m_stack->getLayer(index));
|
||||
updateControls();
|
||||
m_pLayer->redrawWeights(m_weightIndex);
|
||||
m_pLayer->setTrainingData(m_stack->trainingData().row(m_trainingIndex));
|
||||
if (m_stack->trainingData().n_rows > 0)
|
||||
{
|
||||
m_pLayer->setTrainingData(m_stack->trainingData().row(m_trainingIndex));
|
||||
}
|
||||
//[/UserComboBoxCode_m_rbmSelect]
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -198,7 +198,7 @@ void Stack::train(Rbm::IListener* pListener)
|
||||
while(pLayer)
|
||||
{
|
||||
std::cout << m_name << ": " << " Training of layer " << std::to_string(pLayer->id()) << std::endl;
|
||||
pLayer->train(trainingData(pLayer), pListener);
|
||||
pLayer->train(m_trainingData, pListener);
|
||||
pLayer = pLayer->next;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user