[mlpack-git] master: Workaround for the fact that BallBounds may have larger furthest descendant distances in their children. (813441a)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 21:59:51 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40
>---------------------------------------------------------------
commit 813441af376d1b84cc8e5dffaa50b862d76309b9
Author: Ryan Curtin <ryan at ratml.org>
Date: Tue Aug 26 16:15:31 2014 +0000
Workaround for the fact that BallBounds may have larger furthest descendant
distances in their children.
>---------------------------------------------------------------
813441af376d1b84cc8e5dffaa50b862d76309b9
src/mlpack/methods/neighbor_search/neighbor_search_rules_impl.hpp | 7 ++++---
1 file changed, 4 insertions(+), 3 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 9a009d9..20172d3 100644
--- a/src/mlpack/methods/neighbor_search/neighbor_search_rules_impl.hpp
+++ b/src/mlpack/methods/neighbor_search/neighbor_search_rules_impl.hpp
@@ -364,10 +364,11 @@ inline double NeighborSearchRules<SortPolicy, MetricType, TreeType>::
for (size_t i = 0; i < queryNode.NumChildren(); ++i)
{
const double firstBound = queryNode.Child(i).Stat().FirstBound();
+ const double adjustment = std::max(0.0,
+ queryNode.FurthestDescendantDistance() -
+ queryNode.Child(i).FurthestDescendantDistance());
const double adjustedSecondBound = SortPolicy::CombineWorst(
- queryNode.Child(i).Stat().SecondBound(),
- 2 * (queryNode.FurthestDescendantDistance() -
- queryNode.Child(i).FurthestDescendantDistance()));
+ queryNode.Child(i).Stat().SecondBound(), 2 * adjustment);
if (SortPolicy::IsBetter(worstDistance, firstBound))
worstDistance = firstBound;
More information about the mlpack-git
mailing list