- poet use AStack::weightsInit
- AStack::weightsSave continue for other layer on failure git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@854 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+4
-5
@@ -132,16 +132,15 @@ bool AStack::loadWeights(const std::string &dir)
|
|||||||
|
|
||||||
bool AStack::saveWeights(const std::string &dir)
|
bool AStack::saveWeights(const std::string &dir)
|
||||||
{
|
{
|
||||||
|
bool result = true;
|
||||||
Layer *pLayer = m_pLayers;
|
Layer *pLayer = m_pLayers;
|
||||||
while(pLayer)
|
while(pLayer)
|
||||||
{
|
{
|
||||||
if (!pLayer->weightsSave(dir, m_name))
|
bool success = pLayer->weightsSave(dir, m_name);
|
||||||
{
|
result &= success;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
pLayer = pLayer->next;
|
pLayer = pLayer->next;
|
||||||
}
|
}
|
||||||
return true;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
arma::mat& AStack::trainingBatch()
|
arma::mat& AStack::trainingBatch()
|
||||||
|
|||||||
+1
-4
@@ -133,10 +133,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (command == Command::Reset)
|
if (command == Command::Reset)
|
||||||
{
|
{
|
||||||
for (int i=0; i < stack->numLayers(); i++)
|
stack->weightsInit(0.01);
|
||||||
{
|
|
||||||
stack->getLayer(i)->weightsInit(0.01);
|
|
||||||
}
|
|
||||||
stack->saveWeights(".");
|
stack->saveWeights(".");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user