diff --git a/src/mlpack/core/optimizers/lbfgs/lbfgs_impl.hpp b/src/mlpack/core/optimizers/lbfgs/lbfgs_impl.hpp index 708e8447d5..be4d473612 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::Optimize(arma::mat& iterate, return function.Evaluate(iterate); } - -// convert the object to a string +// Convert the object to a string. template -std::string L_BFGS::ToString() const{ +std::string L_BFGS::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(); }