[mlpack] 147/324: Patch from Zhihao: sa_update.diff.

Barak A. Pearlmutter barak+git at cs.nuim.ie
Sun Aug 17 08:22:05 UTC 2014


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit c8a057b82e45f5be571529cdec0c30416cdb2a5e
Author: rcurtin <rcurtin at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Tue Jul 8 12:50:36 2014 +0000

    Patch from Zhihao: sa_update.diff.
    
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16786 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/core/optimizers/sa/sa_impl.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/core/optimizers/sa/sa_impl.hpp b/src/mlpack/core/optimizers/sa/sa_impl.hpp
index fdab618..62bd139 100644
--- a/src/mlpack/core/optimizers/sa/sa_impl.hpp
+++ b/src/mlpack/core/optimizers/sa/sa_impl.hpp
@@ -59,7 +59,7 @@ double SA<FunctionType, CoolingScheduleType>::Optimize(arma::mat &iterate)
 
   size_t frozenCount = 0;
   double energy = function.Evaluate(iterate);
-  size_t oldEnergy = energy;
+  double oldEnergy = energy;
   math::RandomSeed(std::time(NULL));
 
   size_t idx = 0;
@@ -87,7 +87,7 @@ double SA<FunctionType, CoolingScheduleType>::Optimize(arma::mat &iterate)
       frozenCount = 0;
 
     // Terminate, if possible.
-    if (frozenCount >= maxToleranceSweep * iterate.n_elem)
+    if (frozenCount >= maxToleranceSweep * moveCtrlSweep * iterate.n_elem)
     {
       Log::Debug << "SA: minimized within tolerance " << tolerance << " for "
           << maxToleranceSweep << " sweeps after " << i << " iterations; "

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list