- refactored

git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@818 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2022-01-17 15:03:50 +00:00
parent a372f1a30d
commit bd88074994
8 changed files with 100 additions and 59 deletions
+2 -17
View File
@@ -143,23 +143,8 @@ void Layer::calcContextBatch(arma::mat& batch)
void Layer::train(const arma::mat& batch, IListener* pListener)
{
Rbm::train(trainingData(batch), pListener);
}
arma::mat Layer::trainingData(const arma::mat& batch)
{
arma::mat thisBatch = batch;
Layer *pLayer = root();
while (pLayer)
{
if (pLayer == this)
{
break;
}
thisBatch = pLayer->toHiddenProbs(thisBatch);
pLayer = pLayer->next;
}
return thisBatch;
std::cout << m_name << ": " << " Training of layer " << std::to_string(id()) << std::endl;
Rbm::train(batch, pListener);
}
bool Layer::weightsLoad(std::string const &dir, std::string const &prj)