[mlpack-git] [mlpack/mlpack] Implemeted gradient descent optimizer. (#792)

Ryan Curtin notifications at github.com
Wed Sep 28 22:05:08 EDT 2016


rcurtin commented on this pull request.



> +  double overallObjective = function.Evaluate(iterate);
+  double lastObjective = DBL_MAX;
+
+  // Now iterate!
+  arma::vec gradient(iterate.n_cols);
+  for (size_t i = 1; i != maxIterations; ++i)
+  {
+    // Output current objective function.
+    Log::Info << "Gradient Descent: iteration " << i << ", objective " 
+      << overallObjective << "." << std::endl;
+
+    if (std::isnan(overallObjective) || std::isinf(overallObjective))
+    {
+      Log::Warn << "Gradient Descent: converged to " << overallObjective 
+        << "; terminating" << " with failure.  Try a smaller step size?" 
+        << std::endl;

Continued lines should be intended two tabs from the previous line, not one :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/792#pullrequestreview-2062190
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160928/ece0870d/attachment.html>


More information about the mlpack-git mailing list