- integrated RnnStack

git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@826 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2022-01-18 08:36:10 +00:00
parent 9b2861e3d8
commit 17770f402c
10 changed files with 130 additions and 34 deletions
-17
View File
@@ -118,23 +118,6 @@ arma::mat Layer::vc_to_v(const arma::mat& vc) const
return arma::reshape(vc, 1, numVisible() - m_numContext);
}
void Layer::calcContextBatch(arma::mat& batch)
{
size_t numTraining = batch.n_rows;
if (m_numContext > 0 and numTraining > 0)
{
for (int i = 1; i < numTraining; i++)
{
arma::mat v = batch.row(i - 1);
arma::mat h = arma::zeros(1, numHidden());
gibbs_vh(v, h);
arma::mat training_with_ctx = arma::join_rows(batch.row(i).cols(0, numVisible() - m_numContext - 1), h);
batch.row(i) = training_with_ctx;
}
}
}
void Layer::train(const arma::mat& batch, IListener* pListener)
{
std::cout << m_name << ": " << " Training of layer " << std::to_string(id()) << std::endl;