[mlpack-git] master, mlpack-1.0.x: Better rule, which forces the score to 0 for AllkNN. Not sure if it'll work for AllkFN. Also, I think there may be a bug in the traversal info handling for the BinarySpaceTree DualTreeTraverser. (aa321b0)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:45:09 EST 2015


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

On branches: master,mlpack-1.0.x
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

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

commit aa321b076562616f529adb0a23cf942865723473
Author: Ryan Curtin <ryan at ratml.org>
Date:   Mon Mar 10 11:51:37 2014 +0000

    Better rule, which forces the score to 0 for AllkNN.  Not sure if it'll work for AllkFN.  Also, I think there may be a bug in the traversal info handling for the BinarySpaceTree DualTreeTraverser.


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

aa321b076562616f529adb0a23cf942865723473
 src/mlpack/methods/neighbor_search/neighbor_search_rules_impl.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/methods/neighbor_search/neighbor_search_rules_impl.hpp b/src/mlpack/methods/neighbor_search/neighbor_search_rules_impl.hpp
index f7e1040..e276843 100644
--- a/src/mlpack/methods/neighbor_search/neighbor_search_rules_impl.hpp
+++ b/src/mlpack/methods/neighbor_search/neighbor_search_rules_impl.hpp
@@ -195,7 +195,7 @@ inline double NeighborSearchRules<SortPolicy, MetricType, TreeType>::Score(
     // on the query descendant distance and the distance between the query node
     // and last traversal query node, but this case doesn't actually happen for
     // kd-trees or cover trees.
-    adjustedScore = SortPolicy::CombineBest(adjustedScore, bestDistance);
+    adjustedScore = SortPolicy::CombineBest(adjustedScore, adjustedScore);
   }
 
   if (traversalInfo.LastReferenceNode() == referenceNode.Parent())
@@ -217,7 +217,7 @@ inline double NeighborSearchRules<SortPolicy, MetricType, TreeType>::Score(
     // on the reference descendant distance and the distance between the
     // reference node and last traversal reference node, but this case doesn't
     // actually happen for kd-trees or cover trees.
-    adjustedScore = SortPolicy::CombineBest(adjustedScore, bestDistance);
+    adjustedScore = SortPolicy::CombineBest(adjustedScore, adjustedScore);
   }
 
   // Can we prune?



More information about the mlpack-git mailing list