- Layer: removed legacy weights load/save

git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@777 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2022-01-10 15:48:51 +00:00
parent bfbd837ed5
commit 03a6624017
3 changed files with 36 additions and 136 deletions
+2 -36
View File
@@ -81,42 +81,8 @@ public:
return whv().n_cols;
}
bool weightsLoad(std::string const &dir, std::string const &prj)
{
arma::mat w;
arma::mat bh;
arma::mat bv;
bool result = true;
result &= w.load(filePrefix(prj) + ".w.dat", arma::arma_ascii);
result &= bh.load(filePrefix(prj) + ".bh.dat", arma::arma_ascii);
result &= bv.load(filePrefix(prj) + ".bv.dat", arma::arma_ascii);
if (result)
{
std::cout << "Layer " << m_id << ": Importing weights" << std::endl;
weightsAssign(w, bh, bv);
}
else
{
return loadWeights(prj);
}
return true;
}
bool weightsSave(std::string const &dir, std::string const &prj)
{
bool result = true;
result &= whv().save(filePrefix(prj) + ".w.dat", arma::arma_ascii);
result &= bh().save(filePrefix(prj) + ".bh.dat", arma::arma_ascii);
result &= bv().save(filePrefix(prj) + ".bv.dat", arma::arma_ascii);
if (result)
{
std::cout << "Layer " << m_id << ": Exporting weights" << std::endl;
}
return result;
}
bool weightsLoad(std::string const &dir, std::string const &prj);
bool weightsSave(std::string const &dir, std::string const &prj);
arma::mat trainingData(arma::mat const &batch)
{