- fixed progress indicator

- cleaned up


git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@624 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2019-11-07 16:21:35 +00:00
parent 5d281ddca6
commit 4e21dd8114
5 changed files with 50 additions and 33 deletions
+3 -4
View File
@@ -23,7 +23,7 @@
//==============================================================================
RbmComponent::RbmComponent (const std::string &name, size_t id, size_t numVisibleX, size_t numVisibleY, size_t numHidden)
RbmComponent::RbmComponent (const std::string &name, size_t id, size_t numVisibleX, size_t numVisibleY, size_t numHidden, RbmComponentListener *pListener)
: Layer(name, id, numVisibleX, numVisibleY, numHidden)
, m_currWeightIndexToDraw(0)
, m_currTrainingIndexToDraw(0)
@@ -31,7 +31,7 @@ RbmComponent::RbmComponent (const std::string &name, size_t id, size_t numVisibl
, DrawReconstruction(nullptr)
, DrawWeights(nullptr)
, DrawHidden(nullptr)
, m_listener(nullptr)
, m_listener(pListener)
{
addAndMakeVisible (DrawTraining = new DrawComponent (numVisibleX, numVisibleY));
DrawTraining->setListener(this);
@@ -195,13 +195,12 @@ void RbmComponent::mouseWheelMove (const MouseEvent& e, const MouseWheelDetails&
bool RbmComponent::onProgress(const Rbm::Status &status)
{
// mylog("Training %f %%\n", obj.getProgress()*100);
upPass(DrawHidden->getData());
redrawReconstruction();
redrawWeights();
if (m_listener)
{
m_listener->onProgressChanged((size_t)(status.progress + 0.5));
return m_listener->onProgressChanged((size_t)(100*status.progress + 0.5));
}
return true;
}