[mlpack-svn] r16257 - mlpack/trunk/src/mlpack/core/optimizers/sgd

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Feb 10 09:11:12 EST 2014


Author: rcurtin
Date: Mon Feb 10 09:11:11 2014
New Revision: 16257

Log:
Minor fixes to ToString().


Modified:
   mlpack/trunk/src/mlpack/core/optimizers/sgd/sgd_impl.hpp

Modified: mlpack/trunk/src/mlpack/core/optimizers/sgd/sgd_impl.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core/optimizers/sgd/sgd_impl.hpp	(original)
+++ mlpack/trunk/src/mlpack/core/optimizers/sgd/sgd_impl.hpp	Mon Feb 10 09:11:11 2014
@@ -97,18 +97,18 @@
   return overallObjective;
 }
 
-//Convert the Object to a String
+// Convert the object to a string.
 template<typename DecomposableFunctionType>
-std::string SGD<DecomposableFunctionType>::ToString() const{
+std::string SGD<DecomposableFunctionType>::ToString() const
+{
   std::ostringstream convert;
   convert << "SGD [" << this << "]" << std::endl;
-  // Fix this! Why Only log? Ostream is lonely.
-  Log::Debug << "  Function: " << function << std::endl;
+  convert << "  Function:" << std::endl;
+  convert << util::Indent(function.ToString(), 2);
   convert << "  StepSize: " << stepSize << std::endl;
   convert << "  Maximum Iterations: " << maxIterations << std::endl;
   convert << "  Tolerance: " << tolerance << std::endl;
-  convert << "  Shuffle: " << shuffle << std::endl;
-  convert << std::endl;
+  convert << "  Shuffle: " << (shuffle ? "true" : "false") << std::endl;
   return convert.str();
 }
 



More information about the mlpack-svn mailing list