- refactored

- use Armadillo for load/save of weight and training data

git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@775 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2022-01-10 15:25:52 +00:00
parent 952cf26930
commit ff2086a1ff
9 changed files with 125 additions and 65 deletions
+5 -5
View File
@@ -215,11 +215,11 @@ void RbmComponent::onDraw(DrawComponent &obj)
}
if (&obj == DrawVisibleTrain)
{
upDownPass(getTraining());
upDownPass(getTrainingPattern());
}
if (&obj == DrawContextTrain)
{
upDownPass(getTraining());
upDownPass(getTrainingPattern());
}
}
@@ -249,14 +249,14 @@ void RbmComponent::buttonClicked(Button* buttonThatWasClicked)
else if (buttonThatWasClicked == m_buttonCopyH2C)
{
DrawContextTrain->getData() = DrawHidden->getData();
upDownPass(getTraining());
upDownPass(getTrainingPattern());
}
}
void RbmComponent::redrawReconstruction()
{
RbmComponent *pComp = static_cast<RbmComponent*> (root());
pComp->upDownPass(pComp->getTraining());
pComp->upDownPass(pComp->getTrainingPattern());
}
void RbmComponent::gibbs(const arma::mat& vc)
@@ -277,7 +277,7 @@ void RbmComponent::gibbs(const arma::mat& vc)
DrawContextReconst->DrawData();
}
arma::mat RbmComponent::getTraining() const
arma::mat RbmComponent::getTrainingPattern() const
{
return arma::join_rows(DrawVisibleTrain->getData(), DrawContextTrain->getData());
}