[mlpack-git] [mlpack/mlpack] Spill trees (#747)
notifications at github.com
Tue Aug 16 21:25:42 EDT 2016
> + // better, then take it.
> + if (SortPolicy::IsBetter(queryNode.Parent()->Stat().FirstBound(),
> + worstDistance))
> + worstDistance = queryNode.Parent()->Stat().FirstBound();
> + }
> + // Could the existing bounds be better?
> + if (SortPolicy::IsBetter(queryNode.Stat().FirstBound(), worstDistance))
> + worstDistance = queryNode.Stat().FirstBound();
> + // Cache bounds for later.
> + queryNode.Stat().FirstBound() = worstDistance;
> + worstDistance = SortPolicy::Relax(worstDistance, epsilon);
> + return worstDistance;
@rcurtin , The `Score()` calculation is different too, because I consider the special case of overlapping nodes. As there are 3 different methods, I thought it would preferable to have a different implementation, but I agree this means some duplicated code. I was not sure what was preferable, some duplicated code with the advantage of not modifying the original search rules, or more compact code but a bit more complex.
As I have to access the `Overlap()` method of Spill Trees and it is not included in all tree types, I can't use the `#ifdef` approach, because we will have a compiler error when instantiating with a different tree type. I think I should consider template specialization for the Score() methods.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mlpack-git