FALCONN-LIB / FALCONN

FAst Lookups of Cosine and Other Nearest Neighbors (based on fast locality-sensitive hashing)
http://falconn-lib.org/
MIT License
1.14k stars 194 forks source link

Maximum inner product search #51

Open musicformellons opened 8 years ago

musicformellons commented 8 years ago

The readme states: "Despite being designed for the cosine similarity, FALCONN can often be used for nearest neighbor search under the Euclidean distance or a maximum inner product search."

So how would one go about using the maximum inner product search?

ludwigschmidt commented 8 years ago

If your data points all have (approximately) the same norm, you can use your data without modifications because the nearest neighbor under the cosine similarity is also the point with the maximum inner product.

If your data points have different norms, you can try the approach described in the following paper: http://arxiv.org/pdf/1410.5518v3.pdf Currently we have not implemented this transformation in FALCONN directly, but we might do so in the future.