- added StackCreator
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@823 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+10
-9
@@ -15,14 +15,15 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
DeepStack::DeepStack(const std::string &dir, const std::string &name, StackType type)
|
||||
: AStack(dir, type, name)
|
||||
DeepStack::DeepStack(const std::string &name)
|
||||
: AStack(StackType::Deep, name)
|
||||
{
|
||||
}
|
||||
|
||||
DeepStack::DeepStack(const DeepStack& orig)
|
||||
: AStack(orig)
|
||||
DeepStack::DeepStack(const std::string &name, Json::Value& layers, LayerConstructor* pLayerConstructor)
|
||||
: AStack(StackType::Deep, name, layers, pLayerConstructor)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
DeepStack::~DeepStack()
|
||||
@@ -62,10 +63,10 @@ arma::mat& DeepStack::trainingBatch()
|
||||
return m_trainingBatch;
|
||||
}
|
||||
|
||||
size_t DeepStack::loadTrainingBatch(bool doNormalize)
|
||||
size_t DeepStack::loadTrainingBatch(const std::string &dir, bool doNormalize)
|
||||
{
|
||||
std::string filename = m_dir + "/" + m_name + ".training.dat";
|
||||
std::string path = m_dir + "/" + m_name + ".training.dat";
|
||||
std::string filename = dir + "/" + m_name + ".training.dat";
|
||||
std::string path = dir + "/" + m_name + ".training.dat";
|
||||
bool success = m_trainingBatch.load(filename, arma::arma_ascii);
|
||||
|
||||
if (success)
|
||||
@@ -95,9 +96,9 @@ size_t DeepStack::loadTrainingBatch(bool doNormalize)
|
||||
return m_trainingBatch.n_rows;
|
||||
}
|
||||
|
||||
size_t DeepStack::saveTrainingBatch()
|
||||
size_t DeepStack::saveTrainingBatch(const std::string &dir)
|
||||
{
|
||||
std::string filename = m_dir + "/" + m_name + ".training.dat";
|
||||
std::string filename = dir + "/" + m_name + ".training.dat";
|
||||
bool success = m_trainingBatch.save(filename, arma::arma_ascii);
|
||||
|
||||
if (success)
|
||||
|
||||
Reference in New Issue
Block a user