matlab - How to bucket locality-sensitive hashes? -
i have algorithm produce locality-sensitive hashes, how should bucket them take advantage of characteristics(i.e. similar elements have near hashes(with hamming distance))?
in matlab code found create distance matrix between hashes of points search , hashes of points in database, simplify code,while referencing called charikar method implementation of search method.
i tried search that, i'm not sure how apply case of methods found(like multi-probe method). none of these techniques seems pluggable if have hashes. there simple example code this? or suggestion?
this link page matlab code i'm talking about: http://www.eecs.berkeley.edu/~kulis/klsh/klsh.htm
based on: search in locality sensitive hashing this, after reading similarity estimation techniques rounding algorithms:
this question somehow broad, going give minimal (abstract) example here:
we have 6 (= n
) vectors in our dataset, d
bits each. let's assume 2 (= n
) random permutation.
let 1st random permutation begin! remember permute the bits, not order of vectors. after permuting bits, maintain order, example:
v1 v5 v0 v3 v2 v4
now query vector, q
, arrives, it's (almost) unlikely going same vector in our dataset (after permutation), won't find performing binary search.
however, going end between 2 vectors. can imagine scenario (for example q
lies between v0 , v3:
v1 v5 v0 <-- pointer <-- q lies here v3 <-- down pointer v2 v4
now move either or down pointer, seeking vi vector match @ bits q
. let's v0.
similarly, second permutation , find vector vi, let's v4. compare v0 first permutation , v4, see 1 closest q
, i.e. 1 has bits equal q
.
however, if seeking ready implementation, should ask in software recommendation. @ paper linked to see if author(s) made code public, or if share after contacting them.
Comments
Post a Comment