[RBM]
- refactored RbmComponent git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@294 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
|
||||
+12
-59
@@ -74,74 +74,27 @@ public:
|
||||
void setUseProbsForHiddenReconstruction(bool enable);
|
||||
void setUseVisibleGaussian(bool enable);
|
||||
void setDoSparse(bool enable);
|
||||
void setNormalizeData(bool enable)
|
||||
{
|
||||
m_pRbm->setNormalizeData(enable);
|
||||
}
|
||||
|
||||
void setNormalizeData(bool enable);
|
||||
void setLambda(double value);
|
||||
void setSigmaDecay(double value);
|
||||
void setWeightDecay(double value);
|
||||
void setSparsity(double value);
|
||||
void setNumGibbs(size_t value);
|
||||
void setSigma(double value);
|
||||
|
||||
void setMuWeights(double value)
|
||||
{
|
||||
m_pRbm->setMuWeights(value);
|
||||
}
|
||||
|
||||
void setMuSparsity(double value)
|
||||
{
|
||||
m_pRbm->setMuSparsity(value);
|
||||
}
|
||||
|
||||
void setMomentum(double value)
|
||||
{
|
||||
m_pRbm->setMomentum(value);
|
||||
}
|
||||
|
||||
void addFromTraining()
|
||||
{
|
||||
DrawReconstruction->getData() = DrawTraining->getData();
|
||||
DrawReconstruction->DrawData();
|
||||
|
||||
}
|
||||
|
||||
void selectWeights(size_t index)
|
||||
{
|
||||
m_currWeightIndexToDraw = index;
|
||||
redrawWeights();
|
||||
}
|
||||
|
||||
void selectTraining(size_t index)
|
||||
{
|
||||
if (m_pRbm->getBatch().rows() > 0)
|
||||
{
|
||||
m_currTrainingIndexToDraw = index;
|
||||
DrawTraining->getData() = m_pRbm->getBatch().row(index);
|
||||
DrawTraining->DrawData();
|
||||
|
||||
redrawReconstruction();
|
||||
}
|
||||
}
|
||||
|
||||
void copyReconstructionToTraining()
|
||||
{
|
||||
DrawTraining->getData() = DrawReconstruction->getData();
|
||||
DrawTraining->DrawData();
|
||||
}
|
||||
|
||||
void setMuWeights(double value);
|
||||
void setMuSparsity(double value);
|
||||
void setMomentum(double value);
|
||||
void addFromTraining();
|
||||
void setWeightsIndex(size_t index);
|
||||
void setTrainingIndex(size_t index);
|
||||
void copyReconstructionToTraining();
|
||||
void redrawWeights();
|
||||
void redrawReconstruction();
|
||||
void train(size_t numEpochs)
|
||||
void train(size_t numEpochs);
|
||||
RowVectorXd const& getTrainingData();
|
||||
MatrixXd getHiddenBatch()
|
||||
{
|
||||
m_pRbm->train(numEpochs);
|
||||
}
|
||||
|
||||
RowVectorXd const& getTrainingData()
|
||||
{
|
||||
return DrawTraining->getData();
|
||||
return m_pRbm->getHiddenBatch();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user