- use dir in file names

- fixed missing returns
- fixed test app

git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@782 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2022-01-10 17:05:51 +00:00
parent 05fc3aa7c1
commit d5ec722aba
5 changed files with 59 additions and 17 deletions
+6 -7
View File
@@ -49,9 +49,9 @@ bool Layer::weightsLoad(std::string const &dir, std::string const &prj)
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);
result &= w.load(filePrefix(dir, prj) + ".w.dat", arma::arma_ascii);
result &= bh.load(filePrefix(dir, prj) + ".bh.dat", arma::arma_ascii);
result &= bv.load(filePrefix(dir, prj) + ".bv.dat", arma::arma_ascii);
if (result)
{
@@ -65,9 +65,9 @@ bool Layer::weightsLoad(std::string const &dir, std::string const &prj)
bool Layer::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);
result &= whv().save(filePrefix(dir, prj) + ".w.dat", arma::arma_ascii);
result &= bh().save(filePrefix(dir, prj) + ".bh.dat", arma::arma_ascii);
result &= bv().save(filePrefix(dir, prj) + ".bv.dat", arma::arma_ascii);
if (result)
{
@@ -83,7 +83,6 @@ Json::Value Layer::toJson() const
Json::Value layer;
layer["name"] = m_name;
layer["id"] = (int)m_id;
layer["weights_file"] = filePrefix("") + ".weights.dat";
layer["numVisibleX"] = (int)m_numVisibleX;
layer["numVisibleY"] = (int)m_numVisibleY;
layer["numHidden"] = (int)whv().n_cols;