- pass numContext

- fixed crash when numContext == 0

git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@761 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2022-01-09 08:01:25 +00:00
parent 0ee0a732e9
commit c2ffecd66a
10 changed files with 46 additions and 21 deletions
+3 -2
View File
@@ -116,15 +116,16 @@ bool Stack::load(LayerConstructor *pLayerConstructor)
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);
pLayer = new Layer(layername, i, numVisibleX, numVisibleY, numHidden, numContext);
}
else
{
pLayer = pLayerConstructor->onConstruct(layername, i, numVisibleX, numVisibleY, numHidden);
pLayer = pLayerConstructor->onConstruct(layername, i, numVisibleX, numVisibleY, numHidden, numContext);
}
assert(pLayer != nullptr);