[mlpack-git] [mlpack/mlpack] Multiprobe LSH Implementation (#657)

Ryan Curtin notifications at github.com
Mon May 30 17:58:55 EDT 2016


> +  Ao.push_back(0); // initial perturbation holds smallest score (0 if sorted)
> +
> +  std::vector< std::vector<size_t> > perturbationSets;
> +  perturbationSets.push_back(Ao); //storage of perturbation sets
> +
> +  //define a priority queue with CompareGreater as a minheap
> +  std::priority_queue<
> +    std::pair<double, size_t>,        //contents: pairs of (score, index)
> +    std::vector<                      //container: vector of pairs
> +      std::pair<double, size_t>
> +      >,
> +    mlpack::neighbor::CompareGreater  //comparator of pairs (compares scores)
> +  > minHeap; //our minheap
> +
> +  //Start by adding the lowest scoring set to the minheap
> +  std::pair<double, size_t> pair0( perturbationScore(Ao, scores), 0 );

priority_queue is a min-heap and the default comparator is defined for pair, so if you just invert your scores here so you want the min instead of the max I think it will allow you to remove a lot of code, including the custom comparator.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/657/files/2eb6163c90e8e19566784cf960d38d82691221e1#r65107943
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160530/6af4ce7f/attachment.html>


More information about the mlpack-git mailing list