nmslib / hnswlib

Header-only C++/python library for fast approximate nearest neighbors
https://github.com/nmslib/hnswlib
Apache License 2.0
4.11k stars 607 forks source link

Normalization of CLIP Vectors Before Storing in Milvus for Cosine Similarity #557

Closed Bruc3Stark closed 2 months ago

Bruc3Stark commented 2 months ago

After vectors are transformed by the CLIP model, do they need to be normalized before being stored in Milvus? If they are stored in the database without normalization, will it affect the results when calculating cosine similarity?

yurymalkov commented 2 months ago

No, it should affect it if you use cosine. I am not totally sure about milvus, but this is the case for hnswlib