[mlpack-git] master, mlpack-1.0.x: Minor fixes to ToString(). (81c3b81)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:43:00 EST 2015


Repository : https://github.com/mlpack/mlpack

On branches: master,mlpack-1.0.x
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

>---------------------------------------------------------------

commit 81c3b81638d5bd814b7688b2fed542c860aacb9e
Author: Ryan Curtin <ryan at ratml.org>
Date:   Mon Feb 10 14:11:11 2014 +0000

    Minor fixes to ToString().


>---------------------------------------------------------------

81c3b81638d5bd814b7688b2fed542c860aacb9e
 src/mlpack/core/optimizers/sgd/sgd_impl.hpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mlpack/core/optimizers/sgd/sgd_impl.hpp b/src/mlpack/core/optimizers/sgd/sgd_impl.hpp
index 733949c..7af2779 100644
--- a/src/mlpack/core/optimizers/sgd/sgd_impl.hpp
+++ b/src/mlpack/core/optimizers/sgd/sgd_impl.hpp
@@ -97,18 +97,18 @@ double SGD<DecomposableFunctionType>::Optimize(arma::mat& iterate)
   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-git mailing list