Locality Sensitive Hashing Algorithms
Implementation of locality sensitive hashing algorithms for approximate nearest neighbour search.
Usage
import lsh_naive, lsh_hierarchical, lsh_multiprobe
# Define hash-table parameters
n_dims = 32
k = 8
L = 201
n_candidates = 10
R = 0.40
# Setup hash-table
ht = lsh_naive.LSH(n_dims=n_dims,k=k,L=L,R=R,n_candidates=n_candidates,query_mode='kdtree')
ht.setup(data)
# Query Approximate NN
best_match, top_k_data_indices, _ = ht.query(q, top_k = 10)