[mlpack-git] master, mlpack-1.0.x: Minor changes to ToString(). (52f2b20)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:43:04 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 52f2b20cd766202ac280cf2276c7e7a478b2ae3a
Author: Ryan Curtin <ryan at ratml.org>
Date:   Mon Feb 10 14:16:20 2014 +0000

    Minor changes to ToString().


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

52f2b20cd766202ac280cf2276c7e7a478b2ae3a
 src/mlpack/core/optimizers/lbfgs/lbfgs_impl.hpp | 26 +++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/mlpack/core/optimizers/lbfgs/lbfgs_impl.hpp b/src/mlpack/core/optimizers/lbfgs/lbfgs_impl.hpp
index 708e844..be4d473 100644
--- a/src/mlpack/core/optimizers/lbfgs/lbfgs_impl.hpp
+++ b/src/mlpack/core/optimizers/lbfgs/lbfgs_impl.hpp
@@ -419,21 +419,23 @@ double L_BFGS<FunctionType>::Optimize(arma::mat& iterate,
   return function.Evaluate(iterate);
 }
 
-
-// convert the object to a string
+// Convert the object to a string.
 template<typename FunctionType>
-std::string L_BFGS<FunctionType>::ToString() const{
+std::string L_BFGS<FunctionType>::ToString() const
+{
   std::ostringstream convert;
   convert << "L_BFGS [" << this << "]" << std::endl;
-  convert << "  Memory Size: " << numBasis << std::endl;
-  convert << "  Cube Size" << s.n_rows << "x" << s.n_cols << "x" << s.n_slices;
-  convert << std::endl;
-  convert << "  Maximum Iterations: " << maxIterations << std::endl;
-  convert << "  Armijo condition Parameter: " << armijoConstant << std::endl;
-  convert << "  Wolfe Parameter: " << wolfe << std::endl;
-  convert << "  Minimum Gradient: " << minGradientNorm << std::endl;
-  convert << "  Minimum Step of Line Search: " << minStep << std::endl;
-  convert << "  Maximum Step of Line Search: " << maxStep << std::endl;
+  convert << "  Function:" << std::endl;
+  convert << util::Indent(function.ToString(), 2);
+  convert << "  Memory size: " << numBasis << std::endl;
+  convert << "  Cube size: " << s.n_rows << "x" << s.n_cols << "x"
+      << s.n_slices << std::endl;
+  convert << "  Maximum iterations: " << maxIterations << std::endl;
+  convert << "  Armijo condition constant: " << armijoConstant << std::endl;
+  convert << "  Wolfe parameter: " << wolfe << std::endl;
+  convert << "  Minimum gradient norm: " << minGradientNorm << std::endl;
+  convert << "  Minimum step for line search: " << minStep << std::endl;
+  convert << "  Maximum step for line search: " << maxStep << std::endl;
   return convert.str();
 }
 



More information about the mlpack-git mailing list