Fix convergence criterion according to Nishant's suggestion.

This commit is contained in:
Ryan Curtin
2014-12-03 01:59:28 +00:00
parent f17f8b0cf2
commit 0fa1b465bf
@@ -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;
}