-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sklearn and faiss give different result with range_search #1630
Comments
Did you use the squared radius in Faiss? |
Aaah, you're right, replacing Just one more thing. When |
Faiss is not optimized for low-dimensional (<20 dimensions, say) use cases in general; i.e., it would likely take as much time to do this on 32 dimensional vectors as it would on 2 dimensional vectors. range_search is not currently implemented on the GPU (it is planned for H1 2021). An alternative is using something like pytorch and matrix multiplying There might be a primitive in pytorch3d which is appropriate and more optimized for 2 dimensional data here for GPU. |
Thank you for your reply and time! |
Hello! This is probably not an issue but just me not using faiss properly. I could not reproduce the results of sklearn for finding the R-neighbourhood of
x
iny
. Here is my Python 3 code, that compares the results:The output on my HP ZBook 17 G5 laptop with i7-8850H CPU and 64GB DDR4 RAM is:
As you can see, the faiss neighbourhood is smaller than the sklearn one. How can I fix this?
Also, is there a way to make the faiss code run even faster? (I'm not sure I used all the built-in options to optimize)
The text was updated successfully, but these errors were encountered: