An implementation of efficient LSH inspired by fruit fly brain Reference: A neural algorithm for a fundamental computing problem Science
Please read my blog post explaining the difference between usual LSH and this algorithm here
Follow notebook.ipynb
from flylsh import flylsh
flymodel=flylsh(inputs,hash_length,sampling_ratio,embedding_size) #inputs is a numpy array. Need not be zero centered
nearest_neighbors=flymodel.query(query_idx,num_NNs)
model_mAP=flymodel.findmAP(num_NNs,n_points)