facebookresearch / faiss

A library for efficient similarity search and clustering of dense vectors.
https://faiss.ai
MIT License
30.77k stars 3.58k forks source link

adding nan_euclidean metric #3355

Closed PolarBean closed 2 months ago

PolarBean commented 5 months ago

Summary

Sklearn has recently added support for the nan_euclidean as detailed in this issue https://github.com/scikit-learn/scikit-learn/issues/25319

Is it possible this will be added to faiss in the future? thank you.

mdouze commented 5 months ago

We can make an enhancement of it. For new metrics, the first stage is to support them for brute force search in

https://github.com/facebookresearch/faiss/blob/main/faiss/utils/extra_distances-inl.h

this will enable them for FlatCodes search and HNSW search.

MarcYin commented 4 months ago

Is this going to be implemented for the gpu case?

asadoughi commented 2 months ago

CPU implementation of NaNEuclidean is complete. GPU implementation of NaNEuclidean is not currently prioritized. If you would like NanEuclidean on GPU, please file another issue and provide details of your use case.