Check isinf() too.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user