- refactored
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@824 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -26,10 +26,6 @@ AStack::AStack(StackType type, const std::string &name)
|
||||
{
|
||||
}
|
||||
|
||||
AStack::AStack(const AStack& orig)
|
||||
{
|
||||
}
|
||||
|
||||
AStack::~AStack()
|
||||
{
|
||||
Layer *pLayer = m_pLayers;
|
||||
@@ -41,39 +37,6 @@ AStack::~AStack()
|
||||
}
|
||||
}
|
||||
|
||||
AStack::AStack(StackType type, const std::string &name, Json::Value& layers, LayerConstructor* pLayerConstructor)
|
||||
: m_type(type)
|
||||
, m_name(name)
|
||||
, m_pLayers(nullptr)
|
||||
{
|
||||
for (int i=0; i < layers.size(); i++)
|
||||
{
|
||||
Json::Value &layer = layers[i];
|
||||
|
||||
string layername = layer["name"].asString();
|
||||
int numVisibleX = layer["numVisibleX"].asInt();
|
||||
int numVisibleY = layer["numVisibleY"].asInt();
|
||||
int numHidden = layer["numHidden"].asInt();
|
||||
int numContext = layer["numContext"].asInt();
|
||||
|
||||
Layer *pLayer = nullptr;
|
||||
if (!pLayerConstructor)
|
||||
{
|
||||
pLayer = new Layer(layername, i, numVisibleX, numVisibleY, numHidden, numContext);
|
||||
}
|
||||
else
|
||||
{
|
||||
pLayer = pLayerConstructor->onConstruct(this, layername, i, numVisibleX, numVisibleY, numHidden, numContext);
|
||||
}
|
||||
|
||||
assert(pLayer != nullptr);
|
||||
|
||||
pLayer->fromJson(layer["rbm"]);
|
||||
addLayer(pLayer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
AStack::StackType AStack::type()
|
||||
{
|
||||
return m_type;
|
||||
|
||||
Reference in New Issue
Block a user