/Fly-LSH

An implementation of efficient LSH inspired by fruit fly brain

Primary LanguagePythonMIT LicenseMIT

Build status

Fly-LSH

An implementation of efficient LSH inspired by fruit fly brain Reference: A neural algorithm for a fundamental computing problem Science

Understanding

Please read my blog post explaining the difference between usual LSH and this algorithm here

Usage

Exploring differences between LSH and Fly-LSH

Follow notebook.ipynb

Using Fly-LSH

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)