[mlpack-git] master: Fix #464: the assert was not valid. (f86acf8)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Mon Nov 2 12:19:18 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/f86acf8be2c01568d8b3dcd2e529ee9f20f7585e...156787dd4f372a7fd740f733127ac200ea2564b7

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

commit f86acf8be2c01568d8b3dcd2e529ee9f20f7585e
Author: Ryan Curtin <ryan at ratml.org>
Date:   Wed Oct 28 13:02:16 2015 -0700

    Fix #464: the assert was not valid.


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

f86acf8be2c01568d8b3dcd2e529ee9f20f7585e
 src/mlpack/methods/det/dt_utils.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/methods/det/dt_utils.cpp b/src/mlpack/methods/det/dt_utils.cpp
index d6412a3..0bd0e11 100644
--- a/src/mlpack/methods/det/dt_utils.cpp
+++ b/src/mlpack/methods/det/dt_utils.cpp
@@ -154,11 +154,13 @@ DTree* mlpack::det::Trainer(arma::mat& dataset,
     oldAlpha = alpha;
     alpha = dtree.PruneAndUpdate(oldAlpha, dataset.n_cols, useVolumeReg);
 
-    // Some sanity checks.
+    // Some sanity checks.  It seems that on some datasets, the error does not
+    // increase as the tree is pruned but instead stays the same---hence the
+    // "<=" in the final assert.
     Log::Assert((alpha < std::numeric_limits<double>::max()) ||
         (dtree.SubtreeLeaves() == 1));
     Log::Assert(alpha > oldAlpha);
-    Log::Assert(dtree.SubtreeLeavesLogNegError() < treeSeq.second);
+    Log::Assert(dtree.SubtreeLeavesLogNegError() <= treeSeq.second);
   }
 
   std::pair<double, double> treeSeq(oldAlpha,



More information about the mlpack-git mailing list