- Rbm::onProgress provides object to itself
- MainComponentz is Rbm::IListener git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@635 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -628,7 +628,7 @@ void MainComponent::sliderValueChanged (Slider* sliderThatWasMoved)
|
||||
{
|
||||
//[UserSliderCode_patterSlider] -- add your slider handling code here..
|
||||
m_trainingIndex = (int)sliderThatWasMoved->getValue();
|
||||
m_pLayer->setTrainingData(m_trainingData.row(m_trainingIndex));
|
||||
m_pLayer->setTrainingData(m_stack->training().row(m_trainingIndex));
|
||||
//[/UserSliderCode_patterSlider]
|
||||
}
|
||||
else if (sliderThatWasMoved == WeightsSlider)
|
||||
@@ -815,7 +815,7 @@ void MainComponent::mouseWheelMove (const MouseEvent& e, const MouseWheelDetails
|
||||
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
|
||||
void MainComponent::save ()
|
||||
{
|
||||
m_stack->saveTraining(m_trainingData);
|
||||
m_stack->saveTraining();
|
||||
m_stack->saveWeights();
|
||||
m_stack->save();
|
||||
}
|
||||
@@ -835,12 +835,18 @@ const juce::String& MainComponent::getBaseDir()
|
||||
|
||||
void MainComponent::run()
|
||||
{
|
||||
m_pLayer->train(m_trainingData);
|
||||
m_stack->train(this);
|
||||
}
|
||||
|
||||
bool MainComponent::onProgressChanged(size_t progressPercent)
|
||||
bool MainComponent::onProgress(Rbm *pRbm, const Rbm::Status &status)
|
||||
{
|
||||
m_progressBarSlider->setValue(progressPercent);
|
||||
RbmComponent *pComp = static_cast<RbmComponent*>(pRbm);
|
||||
std::cout << "Progress changed of " << pComp->name() << "." << std::to_string((int)pComp->id()) << std::endl;
|
||||
pComp->upPass(pComp->DrawHidden->getData());
|
||||
pComp->redrawReconstruction();
|
||||
pComp->redrawWeights();
|
||||
|
||||
m_progressBarSlider->setValue((int)(100*status.progress + 0.5));
|
||||
return !m_doStop;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user