- added contextTrain and ContextReconst to RbmComponent

git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@763 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2022-01-09 10:08:56 +00:00
parent 56335914ea
commit 7fed7cea88
3 changed files with 51 additions and 9 deletions
+6 -1
View File
@@ -144,7 +144,7 @@ public:
arma::mat toHiddenProbs(const arma::mat &visible) const
{
return Rbm::prob(v_to_h(arma::join_rows(visible, m_ctx)));
return Rbm::prob(v_to_h(arma::join_rows(visible, m_ctx)));
}
arma::mat toVisibleProbs(const arma::mat &hidden) const
@@ -152,6 +152,11 @@ public:
return arma::reshape(Rbm::prob(h_to_v(hidden)), 1, numVisible() - numContext());
}
arma::mat toContextProbs(const arma::mat &hidden) const
{
return Rbm::prob(h_to_v(hidden)).submat(0, numVisible() - numContext(), 0, numVisible() - 1);
}
size_t numContext() const
{
return m_ctx.size();