Loading include/gdcpp.h +3 −22 Original line number Diff line number Diff line Loading @@ -717,25 +717,6 @@ namespace gdc return fval; } std::string vector2str(const Vector &vec) const { std::stringstream ss1; ss1 << std::fixed << std::showpoint << std::setprecision(6); std::stringstream ss2; ss2 << '['; for(Index i = 0; i < vec.getSize(); ++i) { ss1 << vec(i); ss2 << std::setfill(' ') << std::setw(10) << ss1.str(); if(i != vec.getSize() - 1) ss2 << ' '; ss1.str(""); } ss2 << ']'; return ss2.str(); } public: GradientDescent() Loading Loading @@ -857,11 +838,11 @@ namespace gdc ss << " fval=" << fval; if(verbosity_ > 1) ss << " xval=" << vector2str(xval); ss << " xval=" << xval; if(verbosity_ > 2) ss << " gradient=" << vector2str(gradient); ss << " gradient=" << gradient; if(verbosity_ > 3) ss << " step=" << vector2str(step); ss << " step=" << step; std::cout << ss.str() << std::endl; } Loading Loading
include/gdcpp.h +3 −22 Original line number Diff line number Diff line Loading @@ -717,25 +717,6 @@ namespace gdc return fval; } std::string vector2str(const Vector &vec) const { std::stringstream ss1; ss1 << std::fixed << std::showpoint << std::setprecision(6); std::stringstream ss2; ss2 << '['; for(Index i = 0; i < vec.getSize(); ++i) { ss1 << vec(i); ss2 << std::setfill(' ') << std::setw(10) << ss1.str(); if(i != vec.getSize() - 1) ss2 << ' '; ss1.str(""); } ss2 << ']'; return ss2.str(); } public: GradientDescent() Loading Loading @@ -857,11 +838,11 @@ namespace gdc ss << " fval=" << fval; if(verbosity_ > 1) ss << " xval=" << vector2str(xval); ss << " xval=" << xval; if(verbosity_ > 2) ss << " gradient=" << vector2str(gradient); ss << " gradient=" << gradient; if(verbosity_ > 3) ss << " step=" << vector2str(step); ss << " step=" << step; std::cout << ss.str() << std::endl; } Loading