Check isinf() too.

This commit is contained in:
ryan
2015-10-19 07:56:54 -04:00
parent ecf36c506a
commit 09cd0d67f2
+1 -1
View File
@@ -60,7 +60,7 @@ double SGD<DecomposableFunctionType>::Optimize(arma::mat& iterate)
Log::Info << "SGD: iteration " << i << ", objective " << overallObjective
<< "." << std::endl;
if (std::isnan(overallObjective))
if (std::isnan(overallObjective) || std::isinf(overallObjective))
{
Log::Warn << "SGD: converged to " << overallObjective << "; terminating"
<< " with failure. Try a smaller step size?" << std::endl;