Fix convergence criterion according to Nishant's suggestion.
This commit is contained in:
@@ -255,7 +255,7 @@ double SparseCoding<DictionaryInitializer>::OptimizeDictionary(
|
||||
<< "." << std::endl;
|
||||
Log::Debug << " Improvement: " << std::scientific << improvement << ".\n";
|
||||
|
||||
if (improvement < newtonTolerance)
|
||||
if (normGradient < newtonTolerance)
|
||||
converged = true;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ double SparseCoding<DictionaryInitializer>::OptimizeDictionary(
|
||||
}
|
||||
}
|
||||
}
|
||||
//printf("final reconstruction error: %e\n", norm(data - dictionary * codes, "fro"));
|
||||
|
||||
return normGradient;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user