[mlpack-git] master: Unset Owner() after failed Hamerly prune. This is better than setting it by hand when we're checking if we can prune. (b6a1c36)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 12 16:02:41 EDT 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/eddd7167d69b6c88b271ef2e51d1c20e13f1acd8...70342dd8e5c17e0c164cfb8189748671e9c0dd44

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

commit b6a1c3699ef0b0d6e95c565f6419a2f6e04351fd
Author: Ryan Curtin <ryan at ratml.org>
Date:   Tue Jan 27 17:44:57 2015 -0500

    Unset Owner() after failed Hamerly prune. This is better than setting it by hand when we're checking if we can prune.


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

b6a1c3699ef0b0d6e95c565f6419a2f6e04351fd
 src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp b/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp
index 209f2c5..189b1de 100644
--- a/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp
+++ b/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp
@@ -207,8 +207,6 @@ void DualTreeKMeans<MetricType, MatType, TreeType>::TreeUpdate(
 
   if (allSame)
     node->Stat().Owner() = cluster;
-  else
-    node->Stat().Owner() = clusters; // No owner.
 
   const bool prunedLastIteration = node->Stat().HamerlyPruned();
   node->Stat().HamerlyPruned() = false;
@@ -461,6 +459,11 @@ node->Stat().SecondClosestBound() << " is too loose! -- " << secondClosestDist
         hamerlyPruned += node->NumDescendants();
       }
     }
+    else
+    {
+      // No Hamerly prune, so we don't have a known owner.
+      node->Stat().Owner() = clusters;
+    }
 //    else
 //    {
 //      Log::Warn << "Failed Hamerly prune for r" << node->Begin() << "c" <<



More information about the mlpack-git mailing list