- init weights on model load error
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@830 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+6
-3
@@ -115,16 +115,19 @@ void AStack::weightsInit(double stddev)
|
||||
|
||||
bool AStack::loadWeights(const std::string &dir)
|
||||
{
|
||||
bool result = true;
|
||||
Layer *pLayer = m_pLayers;
|
||||
while(pLayer)
|
||||
{
|
||||
if (!pLayer->weightsLoad(dir, m_name))
|
||||
bool success = pLayer->weightsLoad(dir, m_name);
|
||||
if (!success)
|
||||
{
|
||||
return false;
|
||||
pLayer->weightsInit(0.01, 0);
|
||||
}
|
||||
result &= success;
|
||||
pLayer = pLayer->next;
|
||||
}
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
|
||||
bool AStack::saveWeights(const std::string &dir)
|
||||
|
||||
Reference in New Issue
Block a user