From 2b76e6d0ac86f310e4e1e47e768e43af558c4547 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Mon, 2 Mar 2015 11:23:55 -0500 Subject: [PATCH] This isn't warning output. Make it "info" instead. --- .../aug_lagrangian/aug_lagrangian_impl.hpp | 14 +++++--------- .../aug_lagrangian_test_functions.cpp | 19 ------------------- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_impl.hpp b/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_impl.hpp index 967638ff85..9ed30e7ed1 100644 --- a/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_impl.hpp +++ b/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_impl.hpp @@ -85,15 +85,11 @@ bool AugLagrangian::Optimize(arma::mat& coordinates, size_t it; for (it = 0; it != (maxIterations - 1); it++) { - Log::Warn << "AugLagrangian on iteration " << it + Log::Info << "AugLagrangian on iteration " << it << ", starting with objective " << lastObjective << "." << std::endl; - // Log::Warn << coordinates << std::endl; - -// Log::Warn << trans(coordinates) * coordinates << std::endl; - if (!lbfgs.Optimize(coordinates)) - Log::Warn << "L-BFGS reported an error during optimization." + Log::Info << "L-BFGS reported an error during optimization." << std::endl; // Check if we are done with the entire optimization (the threshold we are @@ -117,7 +113,7 @@ bool AugLagrangian::Optimize(arma::mat& coordinates, // function.EvaluateConstraint(i, coordinates) << std::endl; } - Log::Warn << "Penalty is " << penalty << " (threshold " + Log::Info << "Penalty is " << penalty << " (threshold " << penaltyThreshold << ")." << std::endl; for (size_t i = 0; i < function.NumConstraints(); ++i) @@ -140,7 +136,7 @@ bool AugLagrangian::Optimize(arma::mat& coordinates, // penalty. TODO: this factor should be a parameter (from CLI). The // value of 0.25 is taken from Burer and Monteiro (2002). penaltyThreshold = 0.25 * penalty; - Log::Warn << "Lagrange multiplier estimates updated." << std::endl; + Log::Info << "Lagrange multiplier estimates updated." << std::endl; } else { @@ -148,7 +144,7 @@ bool AugLagrangian::Optimize(arma::mat& coordinates, // parameter (from CLI). The value of 10 is taken from Burer and Monteiro // (2002). augfunc.Sigma() *= 10; - Log::Warn << "Updated sigma to " << augfunc.Sigma() << "." << std::endl; + Log::Info << "Updated sigma to " << augfunc.Sigma() << "." << std::endl; } } diff --git a/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_test_functions.cpp b/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_test_functions.cpp index 8e71e49d9e..e2d0dbb5eb 100644 --- a/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_test_functions.cpp +++ b/src/mlpack/core/optimizers/aug_lagrangian/aug_lagrangian_test_functions.cpp @@ -202,8 +202,6 @@ void LovaszThetaSDP::Gradient(const arma::mat& coordinates, // The gradient is equal to (2 S' R^T)^T, with R being coordinates. // S' = C - sum_{i = 1}^{m} [ y_i - sigma (Tr(A_i * (R^T R)) - b_i)] * A_i // We will calculate it in a not very smart way, but it should work. - // Log::Warn << "Using stupid specialization for gradient calculation!" - // << std::endl; // Initialize S' piece by piece. It is of size n x n. const size_t n = coordinates.n_cols; @@ -252,15 +250,8 @@ void LovaszThetaSDP::Gradient(const arma::mat& coordinates, } } -// Log::Warn << "Calculated S is: " << std::endl << s << std::endl; - gradient = trans(2 * s * trans(coordinates)); -// Log::Warn << "Calculated gradient is: " << std::endl << gradient << std::endl; - - -// Log::Debug << "Evaluating gradient. " << std::endl; - // The gradient of -Tr(ones * X) is equal to -2 * ones * R // arma::mat ones; // ones.ones(coordinates.n_rows, coordinates.n_rows); @@ -358,9 +349,6 @@ const arma::mat& LovaszThetaSDP::GetInitialPoint() if (ceil(r) > vertices) r = vertices; // An upper bound on the dimension. - Log::Debug << "Dimension will be " << ceil(r) << " x " << vertices << "." - << std::endl; - initialPoint.set_size(ceil(r), vertices); // Now we set the entries of the initial matrix according to the formula given @@ -376,13 +364,6 @@ const arma::mat& LovaszThetaSDP::GetInitialPoint() } } - Log::Debug << "Initial matrix " << std::endl << initialPoint << std::endl; - - Log::Warn << "X " << std::endl << trans(initialPoint) * initialPoint - << std::endl; - - Log::Warn << "accu " << accu(trans(initialPoint) * initialPoint) << std::endl; - return initialPoint; }