[RBM]
- added DBN stack - concentrated RBM params into structure git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@295 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+25
-11
@@ -48,6 +48,9 @@ RbmComponent::RbmComponent (Weights &weights, MatrixXd const &batch, RbmComponen
|
||||
addAndMakeVisible (DrawVars = new DrawComponent (vNumX, vNumY));
|
||||
addAndMakeVisible (DrawHidden = new DrawComponent (hNum, 1));
|
||||
DrawHidden->setListener(this);
|
||||
redrawWeights();
|
||||
redrawReconstruction();
|
||||
redrawVariances();
|
||||
//[/UserPreSize]
|
||||
|
||||
setSize (430, 130);
|
||||
@@ -229,7 +232,7 @@ void RbmComponent::redrawReconstruction()
|
||||
m_pRbm->toHidden(DrawHidden->getData(), DrawTraining->getData());
|
||||
m_pRbm->toVisible(DrawReconstruction->getData(), DrawHidden->getData());
|
||||
|
||||
for (i=0; i < m_pRbm->getNumGibbs()-1; i++)
|
||||
for (i=0; i < m_pRbm->params().m_numGibbs-1; i++)
|
||||
{
|
||||
m_pRbm->toHidden(DrawHidden->getData(), DrawReconstruction->getData());
|
||||
m_pRbm->toVisible(DrawReconstruction->getData(), DrawHidden->getData());
|
||||
@@ -244,12 +247,16 @@ void RbmComponent::redrawWeights()
|
||||
DrawWeights->DrawData();
|
||||
}
|
||||
|
||||
void RbmComponent::redrawVariances()
|
||||
{
|
||||
DrawVars->getData() = m_pRbm->getVariableSigma();
|
||||
DrawVars->DrawData();
|
||||
}
|
||||
|
||||
void RbmComponent::setDoLearnVariance(bool value)
|
||||
{
|
||||
m_pRbm->setDoLearnVariance(value);
|
||||
DrawVars->getData() = m_pRbm->getVariableSigma();
|
||||
DrawVars->DrawData();
|
||||
|
||||
redrawVariances();
|
||||
redrawReconstruction();
|
||||
}
|
||||
|
||||
@@ -303,9 +310,7 @@ void RbmComponent::setNumGibbs(size_t value)
|
||||
void RbmComponent::setSigma(double value)
|
||||
{
|
||||
m_pRbm->setConstantSigma(value);
|
||||
DrawVars->getData() = m_pRbm->getVariableSigma();
|
||||
DrawVars->DrawData();
|
||||
|
||||
redrawVariances();
|
||||
redrawReconstruction();
|
||||
}
|
||||
|
||||
@@ -329,11 +334,10 @@ void RbmComponent::setMomentum(double value)
|
||||
m_pRbm->setMomentum(value);
|
||||
}
|
||||
|
||||
void RbmComponent::addFromTraining()
|
||||
void RbmComponent::batchchanged()
|
||||
{
|
||||
DrawReconstruction->getData() = DrawTraining->getData();
|
||||
DrawReconstruction->DrawData();
|
||||
|
||||
m_pRbm->updateHiddenBatch();
|
||||
redrawVariances();
|
||||
}
|
||||
|
||||
void RbmComponent::setWeightsIndex(size_t index)
|
||||
@@ -342,6 +346,11 @@ void RbmComponent::setWeightsIndex(size_t index)
|
||||
redrawWeights();
|
||||
}
|
||||
|
||||
size_t RbmComponent::getWeightsIndex()
|
||||
{
|
||||
return m_currWeightIndexToDraw;
|
||||
}
|
||||
|
||||
void RbmComponent::setTrainingIndex(size_t index)
|
||||
{
|
||||
if (m_pRbm->getBatch().rows() > 0)
|
||||
@@ -354,6 +363,11 @@ void RbmComponent::setTrainingIndex(size_t index)
|
||||
}
|
||||
}
|
||||
|
||||
size_t RbmComponent::getTrainingIndex()
|
||||
{
|
||||
return m_currTrainingIndexToDraw;
|
||||
}
|
||||
|
||||
void RbmComponent::copyReconstructionToTraining()
|
||||
{
|
||||
DrawTraining->getData() = DrawReconstruction->getData();
|
||||
|
||||
Reference in New Issue
Block a user