Skip to content
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

Add normalized_cosine vector search similarity #798

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

aprudhomme
Copy link
Contributor

Adds the normalized_cosine similarity as an option for vector search. The usage is the same as cosine similarity, but the vectors are normalized to unit length before indexing. The query vectors are also automatically normalized, allowing use of faster DOT_PRODUCT similarity internally.

The original magnitudes of the indexed vectors are available in the <field_name>._magitude field. This allows for reconstruction of the original vector, if needed.

@aprudhomme aprudhomme requested a review from sarthakn7 December 26, 2024 18:58
@aprudhomme aprudhomme merged commit a69a73a into Yelp:main Jan 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants