- refactored RbmComponent

git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@294 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2016-06-16 20:09:16 +00:00
parent ff88a62e73
commit b10d06d96c
2 changed files with 73 additions and 59 deletions
+61
View File
@@ -309,6 +309,67 @@ void RbmComponent::setSigma(double value)
redrawReconstruction();
}
void RbmComponent::setNormalizeData(bool enable)
{
m_pRbm->setNormalizeData(enable);
}
void RbmComponent::setMuWeights(double value)
{
m_pRbm->setMuWeights(value);
}
void RbmComponent::setMuSparsity(double value)
{
m_pRbm->setMuSparsity(value);
}
void RbmComponent::setMomentum(double value)
{
m_pRbm->setMomentum(value);
}
void RbmComponent::addFromTraining()
{
DrawReconstruction->getData() = DrawTraining->getData();
DrawReconstruction->DrawData();
}
void RbmComponent::setWeightsIndex(size_t index)
{
m_currWeightIndexToDraw = index;
redrawWeights();
}
void RbmComponent::setTrainingIndex(size_t index)
{
if (m_pRbm->getBatch().rows() > 0)
{
m_currTrainingIndexToDraw = index;
DrawTraining->getData() = m_pRbm->getBatch().row(index);
DrawTraining->DrawData();
redrawReconstruction();
}
}
void RbmComponent::copyReconstructionToTraining()
{
DrawTraining->getData() = DrawReconstruction->getData();
DrawTraining->DrawData();
}
void RbmComponent::train(size_t numEpochs)
{
m_pRbm->train(numEpochs);
}
RowVectorXd const& RbmComponent::getTrainingData()
{
return DrawTraining->getData();
}
//[/MiscUserCode]