- added Stack::setName()
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@668 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -737,6 +737,10 @@ void MainComponent::labelTextChanged (Label* labelThatHasChanged)
|
|||||||
else if (labelThatHasChanged == projectNameLabel)
|
else if (labelThatHasChanged == projectNameLabel)
|
||||||
{
|
{
|
||||||
//[UserLabelCode_projectNameLabel] -- add your label text handling code here..
|
//[UserLabelCode_projectNameLabel] -- add your label text handling code here..
|
||||||
|
if (m_stack)
|
||||||
|
{
|
||||||
|
m_stack->setName(labelThatHasChanged->getText().toStdString());
|
||||||
|
}
|
||||||
//[/UserLabelCode_projectNameLabel]
|
//[/UserLabelCode_projectNameLabel]
|
||||||
}
|
}
|
||||||
else if (labelThatHasChanged == numVisibleYLabel)
|
else if (labelThatHasChanged == numVisibleYLabel)
|
||||||
|
|||||||
+325
-320
@@ -1,320 +1,325 @@
|
|||||||
/*
|
/*
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* File: Stack.cpp
|
* File: Stack.cpp
|
||||||
* Author: jens
|
* Author: jens
|
||||||
*
|
*
|
||||||
* Created on 25. Oktober 2019, 18:26
|
* Created on 25. Oktober 2019, 18:26
|
||||||
*/
|
*/
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include "Stack.hpp"
|
#include "Stack.hpp"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
Stack::Stack(const std::string &dir, const std::string &name)
|
Stack::Stack(const std::string &dir, const std::string &name)
|
||||||
: m_dir(dir)
|
: m_dir(dir)
|
||||||
, m_name(name)
|
, m_name(name)
|
||||||
, m_pLayers(nullptr)
|
, m_pLayers(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Stack::Stack(const Stack& orig)
|
Stack::Stack(const Stack& orig)
|
||||||
: m_dir(orig.m_dir)
|
: m_dir(orig.m_dir)
|
||||||
, m_name(orig.m_name)
|
, m_name(orig.m_name)
|
||||||
, m_pLayers(orig.m_pLayers)
|
, m_pLayers(orig.m_pLayers)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Stack::~Stack()
|
Stack::~Stack()
|
||||||
{
|
{
|
||||||
Layer *pLayer = m_pLayers;
|
Layer *pLayer = m_pLayers;
|
||||||
while(pLayer)
|
while(pLayer)
|
||||||
{
|
{
|
||||||
Layer *pNextLayer = pLayer->next;
|
Layer *pNextLayer = pLayer->next;
|
||||||
delete pLayer;
|
delete pLayer;
|
||||||
pLayer = pNextLayer;
|
pLayer = pNextLayer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Stack::numLayers()
|
void Stack::setName(const std::string& name)
|
||||||
{
|
{
|
||||||
size_t count = 0;
|
m_name = name;
|
||||||
Layer *pLayer = m_pLayers;
|
}
|
||||||
while(pLayer)
|
|
||||||
{
|
size_t Stack::numLayers()
|
||||||
count++;
|
{
|
||||||
pLayer = pLayer->next;
|
size_t count = 0;
|
||||||
}
|
Layer *pLayer = m_pLayers;
|
||||||
return count;
|
while(pLayer)
|
||||||
}
|
{
|
||||||
|
count++;
|
||||||
void Stack::addLayer(Layer *pOtherLayer)
|
pLayer = pLayer->next;
|
||||||
{
|
}
|
||||||
if (!m_pLayers)
|
return count;
|
||||||
{
|
}
|
||||||
m_pLayers = pOtherLayer;
|
|
||||||
pOtherLayer->prev = nullptr;
|
void Stack::addLayer(Layer *pOtherLayer)
|
||||||
}
|
{
|
||||||
else
|
if (!m_pLayers)
|
||||||
{
|
{
|
||||||
Layer *pLayer = m_pLayers;
|
m_pLayers = pOtherLayer;
|
||||||
while(pLayer->next)
|
pOtherLayer->prev = nullptr;
|
||||||
{
|
}
|
||||||
pLayer = pLayer->next;
|
else
|
||||||
}
|
{
|
||||||
pLayer->next = pOtherLayer;
|
Layer *pLayer = m_pLayers;
|
||||||
pOtherLayer->prev = pLayer;
|
while(pLayer->next)
|
||||||
}
|
{
|
||||||
}
|
pLayer = pLayer->next;
|
||||||
|
}
|
||||||
void Stack::delLayer(Layer* pLayer)
|
pLayer->next = pOtherLayer;
|
||||||
{
|
pOtherLayer->prev = pLayer;
|
||||||
assert(!"Stack::delLayer: Not implemented!");
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Layer* Stack::getLayer(size_t layerId) const
|
void Stack::delLayer(Layer* pLayer)
|
||||||
{
|
{
|
||||||
Layer *pLayer = m_pLayers;
|
assert(!"Stack::delLayer: Not implemented!");
|
||||||
while(pLayer)
|
}
|
||||||
{
|
|
||||||
if (pLayer->id() == layerId)
|
Layer* Stack::getLayer(size_t layerId) const
|
||||||
{
|
{
|
||||||
return pLayer;
|
Layer *pLayer = m_pLayers;
|
||||||
}
|
while(pLayer)
|
||||||
pLayer = pLayer->next;
|
{
|
||||||
}
|
if (pLayer->id() == layerId)
|
||||||
return nullptr;
|
{
|
||||||
|
return pLayer;
|
||||||
}
|
}
|
||||||
|
pLayer = pLayer->next;
|
||||||
bool Stack::load(LayerConstructor *pLayerConstructor)
|
}
|
||||||
{
|
return nullptr;
|
||||||
std::cout << "Importing Project " << m_name << std::endl;
|
|
||||||
ifstream ifs(m_dir + "/" + m_name + string(".prj"));
|
}
|
||||||
|
|
||||||
Json::Reader reader;
|
bool Stack::load(LayerConstructor *pLayerConstructor)
|
||||||
Json::Value project;
|
{
|
||||||
reader.parse(ifs, project);
|
std::cout << "Importing Project " << m_name << std::endl;
|
||||||
|
ifstream ifs(m_dir + "/" + m_name + string(".prj"));
|
||||||
const string &name = project["stack"]["name"].asString();
|
|
||||||
Json::Value &layers = project["stack"]["layers"];
|
Json::Reader reader;
|
||||||
|
Json::Value project;
|
||||||
for (int i=0; i < layers.size(); i++)
|
reader.parse(ifs, project);
|
||||||
{
|
|
||||||
Json::Value &layer = layers[i];
|
const string &name = project["stack"]["name"].asString();
|
||||||
|
Json::Value &layers = project["stack"]["layers"];
|
||||||
string layername = layer["name"].asString();
|
|
||||||
int numVisibleX = layer["numVisibleX"].asInt();
|
for (int i=0; i < layers.size(); i++)
|
||||||
int numVisibleY = layer["numVisibleY"].asInt();
|
{
|
||||||
int numHidden = layer["numHidden"].asInt();
|
Json::Value &layer = layers[i];
|
||||||
|
|
||||||
Layer *pLayer = nullptr;
|
string layername = layer["name"].asString();
|
||||||
if (!pLayerConstructor)
|
int numVisibleX = layer["numVisibleX"].asInt();
|
||||||
{
|
int numVisibleY = layer["numVisibleY"].asInt();
|
||||||
pLayer = new Layer(layername, i, numVisibleX, numVisibleY, numHidden);
|
int numHidden = layer["numHidden"].asInt();
|
||||||
}
|
|
||||||
else
|
Layer *pLayer = nullptr;
|
||||||
{
|
if (!pLayerConstructor)
|
||||||
pLayer = pLayerConstructor->onConstruct(layername, i, numVisibleX, numVisibleY, numHidden);
|
{
|
||||||
}
|
pLayer = new Layer(layername, i, numVisibleX, numVisibleY, numHidden);
|
||||||
|
}
|
||||||
assert(pLayer != nullptr);
|
else
|
||||||
|
{
|
||||||
pLayer->fromJson(layer["rbm"]);
|
pLayer = pLayerConstructor->onConstruct(layername, i, numVisibleX, numVisibleY, numHidden);
|
||||||
addLayer(pLayer);
|
}
|
||||||
}
|
|
||||||
|
assert(pLayer != nullptr);
|
||||||
return true;
|
|
||||||
}
|
pLayer->fromJson(layer["rbm"]);
|
||||||
|
addLayer(pLayer);
|
||||||
bool Stack::save()
|
}
|
||||||
{
|
|
||||||
std::cout << "Exporting Project " << m_name << std::endl;
|
return true;
|
||||||
ofstream ofs(m_dir + "/" + m_name + string(".prj"));
|
}
|
||||||
|
|
||||||
Json::StyledWriter writer;
|
bool Stack::save()
|
||||||
Json::Value project;
|
{
|
||||||
project["stack"]["name"] = m_name;
|
std::cout << "Exporting Project " << m_name << std::endl;
|
||||||
|
ofstream ofs(m_dir + "/" + m_name + string(".prj"));
|
||||||
Json::Value layers(Json::arrayValue);
|
|
||||||
Layer *pLayer = m_pLayers;
|
Json::StyledWriter writer;
|
||||||
while(pLayer)
|
Json::Value project;
|
||||||
{
|
project["stack"]["name"] = m_name;
|
||||||
layers.append(pLayer->toJson());
|
|
||||||
pLayer = pLayer->next;
|
Json::Value layers(Json::arrayValue);
|
||||||
}
|
Layer *pLayer = m_pLayers;
|
||||||
project["stack"]["layers"] = layers;
|
while(pLayer)
|
||||||
|
{
|
||||||
ofs << writer.write(project);
|
layers.append(pLayer->toJson());
|
||||||
|
pLayer = pLayer->next;
|
||||||
return true;
|
}
|
||||||
}
|
project["stack"]["layers"] = layers;
|
||||||
|
|
||||||
void Stack::weightsInit(double stddev)
|
ofs << writer.write(project);
|
||||||
{
|
|
||||||
Layer *pLayer = m_pLayers;
|
return true;
|
||||||
while(pLayer)
|
}
|
||||||
{
|
|
||||||
pLayer->weightsInit(stddev);
|
void Stack::weightsInit(double stddev)
|
||||||
pLayer = pLayer->next;
|
{
|
||||||
}
|
Layer *pLayer = m_pLayers;
|
||||||
}
|
while(pLayer)
|
||||||
|
{
|
||||||
bool Stack::loadWeights()
|
pLayer->weightsInit(stddev);
|
||||||
{
|
pLayer = pLayer->next;
|
||||||
Layer *pLayer = m_pLayers;
|
}
|
||||||
while(pLayer)
|
}
|
||||||
{
|
|
||||||
if (!pLayer->loadWeights(m_dir + "/" + m_name))
|
bool Stack::loadWeights()
|
||||||
{
|
{
|
||||||
return false;
|
Layer *pLayer = m_pLayers;
|
||||||
}
|
while(pLayer)
|
||||||
pLayer = pLayer->next;
|
{
|
||||||
}
|
if (!pLayer->loadWeights(m_dir + "/" + m_name))
|
||||||
return true;
|
{
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
bool Stack::saveWeights()
|
pLayer = pLayer->next;
|
||||||
{
|
}
|
||||||
Layer *pLayer = m_pLayers;
|
return true;
|
||||||
while(pLayer)
|
}
|
||||||
{
|
|
||||||
if (!pLayer->saveWeights(m_dir + "/" + m_name))
|
bool Stack::saveWeights()
|
||||||
{
|
{
|
||||||
return false;
|
Layer *pLayer = m_pLayers;
|
||||||
}
|
while(pLayer)
|
||||||
pLayer = pLayer->next;
|
{
|
||||||
}
|
if (!pLayer->saveWeights(m_dir + "/" + m_name))
|
||||||
return true;
|
{
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
void Stack::train(Rbm::IListener* pListener)
|
pLayer = pLayer->next;
|
||||||
{
|
}
|
||||||
Layer *pLayer = m_pLayers;
|
return true;
|
||||||
while(pLayer)
|
}
|
||||||
{
|
|
||||||
std::cout << m_name << ": " << " Training of layer " << std::to_string(pLayer->id()) << std::endl;
|
void Stack::train(Rbm::IListener* pListener)
|
||||||
pLayer->train(m_trainingData, pListener);
|
{
|
||||||
pLayer = pLayer->next;
|
Layer *pLayer = m_pLayers;
|
||||||
}
|
while(pLayer)
|
||||||
}
|
{
|
||||||
|
std::cout << m_name << ": " << " Training of layer " << std::to_string(pLayer->id()) << std::endl;
|
||||||
arma::mat& Stack::trainingData()
|
pLayer->train(m_trainingData, pListener);
|
||||||
{
|
pLayer = pLayer->next;
|
||||||
return m_trainingData;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
arma::mat Stack::trainingData(Layer* pThatLayer)
|
arma::mat& Stack::trainingData()
|
||||||
{
|
{
|
||||||
arma::mat thisBatch = m_trainingData;
|
return m_trainingData;
|
||||||
Layer *pLayer = m_pLayers;
|
}
|
||||||
while (pLayer)
|
|
||||||
{
|
arma::mat Stack::trainingData(Layer* pThatLayer)
|
||||||
if (pLayer->id() == pThatLayer->id())
|
{
|
||||||
{
|
arma::mat thisBatch = m_trainingData;
|
||||||
break;
|
Layer *pLayer = m_pLayers;
|
||||||
}
|
while (pLayer)
|
||||||
thisBatch = pLayer->toHiddenProbs(thisBatch);
|
{
|
||||||
pLayer = pLayer->next;
|
if (pLayer->id() == pThatLayer->id())
|
||||||
}
|
{
|
||||||
return thisBatch;
|
break;
|
||||||
}
|
}
|
||||||
|
thisBatch = pLayer->toHiddenProbs(thisBatch);
|
||||||
size_t Stack::loadTraining(bool doNormalize)
|
pLayer = pLayer->next;
|
||||||
{
|
}
|
||||||
uint32_t numTraining = 0;
|
return thisBatch;
|
||||||
uint32_t numVisible = 0;
|
}
|
||||||
|
|
||||||
std::string filename = m_dir + "/" + m_name + ".training.dat";
|
size_t Stack::loadTraining(bool doNormalize)
|
||||||
FILE *pFile = fopen(filename.c_str(), "r");
|
{
|
||||||
|
uint32_t numTraining = 0;
|
||||||
if (!pFile)
|
uint32_t numVisible = 0;
|
||||||
{
|
|
||||||
std::cout << "Could not open " << filename << "!" << std::endl;
|
std::string filename = m_dir + "/" + m_name + ".training.dat";
|
||||||
return 0;
|
FILE *pFile = fopen(filename.c_str(), "r");
|
||||||
}
|
|
||||||
|
if (!pFile)
|
||||||
int result = fscanf(pFile, "%d\n", &numTraining);
|
{
|
||||||
if (result < 0)
|
std::cout << "Could not open " << filename << "!" << std::endl;
|
||||||
{
|
return 0;
|
||||||
return 0;
|
}
|
||||||
}
|
|
||||||
result = fscanf(pFile, "%d\n", &numVisible);
|
int result = fscanf(pFile, "%d\n", &numTraining);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
m_trainingData = arma::zeros(numTraining, numVisible);
|
result = fscanf(pFile, "%d\n", &numVisible);
|
||||||
|
if (result < 0)
|
||||||
uint32_t i, j;
|
{
|
||||||
for (i=0; i < numTraining; i++)
|
return 0;
|
||||||
{
|
}
|
||||||
for (j=0; j < numVisible; j++)
|
m_trainingData = arma::zeros(numTraining, numVisible);
|
||||||
{
|
|
||||||
float v;
|
uint32_t i, j;
|
||||||
int result = fscanf(pFile, "%f", &v);
|
for (i=0; i < numTraining; i++)
|
||||||
if (result > 0)
|
{
|
||||||
{
|
for (j=0; j < numVisible; j++)
|
||||||
m_trainingData(i, j) = v;
|
{
|
||||||
}
|
float v;
|
||||||
}
|
int result = fscanf(pFile, "%f", &v);
|
||||||
}
|
if (result > 0)
|
||||||
fclose(pFile);
|
{
|
||||||
std::cout << "Loaded " << numTraining << " training samples\n";
|
m_trainingData(i, j) = v;
|
||||||
|
}
|
||||||
if (doNormalize)
|
}
|
||||||
{
|
}
|
||||||
m_trainingData = Rbm::normalize(m_trainingData);
|
fclose(pFile);
|
||||||
}
|
std::cout << "Loaded " << numTraining << " training samples\n";
|
||||||
return numTraining;
|
|
||||||
}
|
if (doNormalize)
|
||||||
|
{
|
||||||
size_t Stack::saveTraining()
|
m_trainingData = Rbm::normalize(m_trainingData);
|
||||||
{
|
}
|
||||||
std::string filename = m_dir + "/" + m_name + ".training.dat";
|
return numTraining;
|
||||||
FILE *pFile = fopen(filename.c_str(), "w");
|
}
|
||||||
|
|
||||||
if (!pFile)
|
size_t Stack::saveTraining()
|
||||||
{
|
{
|
||||||
std::cout << "Could not open " << filename << "!" << std::endl;
|
std::string filename = m_dir + "/" + m_name + ".training.dat";
|
||||||
return 0;
|
FILE *pFile = fopen(filename.c_str(), "w");
|
||||||
}
|
|
||||||
|
if (!pFile)
|
||||||
fprintf(pFile, "%u\n", (uint32_t)m_trainingData.n_rows);
|
{
|
||||||
fprintf(pFile, "%u\n", (uint32_t)m_trainingData.n_cols);
|
std::cout << "Could not open " << filename << "!" << std::endl;
|
||||||
|
return 0;
|
||||||
uint32_t i, j;
|
}
|
||||||
|
|
||||||
for (i=0; i < m_trainingData.n_rows; i++)
|
fprintf(pFile, "%u\n", (uint32_t)m_trainingData.n_rows);
|
||||||
{
|
fprintf(pFile, "%u\n", (uint32_t)m_trainingData.n_cols);
|
||||||
for (j=0; j < m_trainingData.n_cols; j++)
|
|
||||||
{
|
uint32_t i, j;
|
||||||
fprintf(pFile, "%3.6f\n", m_trainingData(i, j));
|
|
||||||
}
|
for (i=0; i < m_trainingData.n_rows; i++)
|
||||||
}
|
{
|
||||||
|
for (j=0; j < m_trainingData.n_cols; j++)
|
||||||
fclose(pFile);
|
{
|
||||||
|
fprintf(pFile, "%3.6f\n", m_trainingData(i, j));
|
||||||
std::cout << "Saved " << m_trainingData.n_rows << " training samples\n";
|
}
|
||||||
return m_trainingData.n_rows;
|
}
|
||||||
}
|
|
||||||
|
fclose(pFile);
|
||||||
size_t Stack::numTraining()
|
|
||||||
{
|
std::cout << "Saved " << m_trainingData.n_rows << " training samples\n";
|
||||||
return m_trainingData.n_rows;
|
return m_trainingData.n_rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stack::addTraining(const arma::mat &toAdd)
|
size_t Stack::numTraining()
|
||||||
{
|
{
|
||||||
m_trainingData.insert_rows(m_trainingData.n_rows, toAdd);
|
return m_trainingData.n_rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stack::delTraining(int index)
|
void Stack::addTraining(const arma::mat &toAdd)
|
||||||
{
|
{
|
||||||
m_trainingData.shed_row(index);
|
m_trainingData.insert_rows(m_trainingData.n_rows, toAdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Stack::delTraining(int index)
|
||||||
|
{
|
||||||
|
m_trainingData.shed_row(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
+73
-72
@@ -1,72 +1,73 @@
|
|||||||
/*
|
/*
|
||||||
* To change this license header, choose License Headers in Project Properties.
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
* To change this template file, choose Tools | Templates
|
* To change this template file, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* File: Stack.hpp
|
* File: Stack.hpp
|
||||||
* Author: jens
|
* Author: jens
|
||||||
*
|
*
|
||||||
* Created on 25. Oktober 2019, 18:26
|
* Created on 25. Oktober 2019, 18:26
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STACK_HPP
|
#ifndef STACK_HPP
|
||||||
#define STACK_HPP
|
#define STACK_HPP
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <armadillo>
|
#include <armadillo>
|
||||||
#include <jsoncpp/json/json.h>
|
#include <jsoncpp/json/json.h>
|
||||||
#include "Layer.hpp"
|
#include "Layer.hpp"
|
||||||
|
|
||||||
class LayerConstructor
|
class LayerConstructor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LayerConstructor() {}
|
LayerConstructor() {}
|
||||||
virtual ~LayerConstructor() {}
|
virtual ~LayerConstructor() {}
|
||||||
|
|
||||||
virtual Layer* onConstruct(const std::string &name, size_t id, size_t numVisibleX, size_t numVisibleY, size_t numHidden)
|
virtual Layer* onConstruct(const std::string &name, size_t id, size_t numVisibleX, size_t numVisibleY, size_t numHidden)
|
||||||
{
|
{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Stack
|
class Stack
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Stack(const std::string &dir, const std::string &name);
|
Stack(const std::string &dir, const std::string &name);
|
||||||
Stack(const Stack& orig);
|
Stack(const Stack& orig);
|
||||||
virtual ~Stack();
|
virtual ~Stack();
|
||||||
|
|
||||||
size_t numLayers();
|
void setName(const std::string &name);
|
||||||
void addLayer(Layer *pLayer);
|
size_t numLayers();
|
||||||
void delLayer(Layer *pLayer);
|
void addLayer(Layer *pLayer);
|
||||||
Layer* getLayer(size_t layerId) const;
|
void delLayer(Layer *pLayer);
|
||||||
|
Layer* getLayer(size_t layerId) const;
|
||||||
void train(Rbm::IListener* pListener);
|
|
||||||
bool load(LayerConstructor *pLayerConstructor=nullptr);
|
void train(Rbm::IListener* pListener);
|
||||||
bool save();
|
bool load(LayerConstructor *pLayerConstructor=nullptr);
|
||||||
void weightsInit(double stddev);
|
bool save();
|
||||||
bool loadWeights();
|
void weightsInit(double stddev);
|
||||||
bool saveWeights();
|
bool loadWeights();
|
||||||
|
bool saveWeights();
|
||||||
size_t numTraining();
|
|
||||||
void addTraining(const arma::mat &toAdd);
|
size_t numTraining();
|
||||||
void delTraining(int index);
|
void addTraining(const arma::mat &toAdd);
|
||||||
size_t loadTraining(bool doNormalize=false);
|
void delTraining(int index);
|
||||||
size_t saveTraining();
|
size_t loadTraining(bool doNormalize=false);
|
||||||
arma::mat& trainingData();
|
size_t saveTraining();
|
||||||
arma::mat trainingData(Layer *pLayer);
|
arma::mat& trainingData();
|
||||||
|
arma::mat trainingData(Layer *pLayer);
|
||||||
private:
|
|
||||||
std::string m_dir;
|
private:
|
||||||
std::string m_name;
|
std::string m_dir;
|
||||||
Layer *m_pLayers;
|
std::string m_name;
|
||||||
arma::mat m_trainingData;
|
Layer *m_pLayers;
|
||||||
|
arma::mat m_trainingData;
|
||||||
};
|
|
||||||
|
};
|
||||||
|
|
||||||
#endif /* STACK_HPP */
|
|
||||||
|
#endif /* STACK_HPP */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user