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

Yannis Mentekidis notifications at github.com
Wed Jun 22 11:06:42 EDT 2016


> +}
> +
> +// Inline function used by GetAdditionalProbingBins. The vector shift operation
> +// replaces the largest element of a vector A with (largest element) + 1.
> +inline void perturbationShift(std::vector<size_t> &A)
> +{
> +  size_t max_pos = 0;
> +  size_t max = A[0];
> +  for (size_t i = 1; i < A.size(); ++i)
> +  {
> +    if (A[i] > max)
> +    {
> +      max = A[i];
> +      max_pos = i;
> +    }
> +  }

What if instead of A storing indices to some of the 2*numProj elements, each A was 2*numProj long and stored 1 if the corresponding element is "included" and 0 otherwise?
So instead of A = [1, 5] we would have A = [0 1 0 0 0 1 0 ... 0]
If arma::Row<bool> compresses its elements then this will avoid both the extra space and the use of std::vector.

---
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/691/files/fa7f62da6a4cfe7fa45e297d7a4a1491c9c39bb1#r68070509
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160622/1c95330e/attachment-0001.html>


More information about the mlpack-git mailing list