[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();
|
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]
|
//[/MiscUserCode]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+12
-59
@@ -74,74 +74,27 @@ public:
|
|||||||
void setUseProbsForHiddenReconstruction(bool enable);
|
void setUseProbsForHiddenReconstruction(bool enable);
|
||||||
void setUseVisibleGaussian(bool enable);
|
void setUseVisibleGaussian(bool enable);
|
||||||
void setDoSparse(bool enable);
|
void setDoSparse(bool enable);
|
||||||
void setNormalizeData(bool enable)
|
void setNormalizeData(bool enable);
|
||||||
{
|
|
||||||
m_pRbm->setNormalizeData(enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setLambda(double value);
|
void setLambda(double value);
|
||||||
void setSigmaDecay(double value);
|
void setSigmaDecay(double value);
|
||||||
void setWeightDecay(double value);
|
void setWeightDecay(double value);
|
||||||
void setSparsity(double value);
|
void setSparsity(double value);
|
||||||
void setNumGibbs(size_t value);
|
void setNumGibbs(size_t value);
|
||||||
void setSigma(double value);
|
void setSigma(double value);
|
||||||
|
void setMuWeights(double value);
|
||||||
void setMuWeights(double value)
|
void setMuSparsity(double value);
|
||||||
{
|
void setMomentum(double value);
|
||||||
m_pRbm->setMuWeights(value);
|
void addFromTraining();
|
||||||
}
|
void setWeightsIndex(size_t index);
|
||||||
|
void setTrainingIndex(size_t index);
|
||||||
void setMuSparsity(double value)
|
void copyReconstructionToTraining();
|
||||||
{
|
|
||||||
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 redrawWeights();
|
void redrawWeights();
|
||||||
void redrawReconstruction();
|
void redrawReconstruction();
|
||||||
void train(size_t numEpochs)
|
void train(size_t numEpochs);
|
||||||
|
RowVectorXd const& getTrainingData();
|
||||||
|
MatrixXd getHiddenBatch()
|
||||||
{
|
{
|
||||||
m_pRbm->train(numEpochs);
|
return m_pRbm->getHiddenBatch();
|
||||||
}
|
|
||||||
|
|
||||||
RowVectorXd const& getTrainingData()
|
|
||||||
{
|
|
||||||
return DrawTraining->getData();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user