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

fix(search): Fix vector search bugs :( #2188

Merged
merged 2 commits into from
Nov 18, 2023

Conversation

dranikpg
Copy link
Contributor

No description provided.

@@ -34,7 +35,7 @@ __attribute__((optimize("fast-math"))) float CosineDistance(const float* u, cons
}

if (float denom = sum_uu * sum_vv; denom != 0.0f)
return sum_uv / sqrt(denom);
return 1 - sum_uv / sqrt(denom);
Copy link
Contributor Author

@dranikpg dranikpg Nov 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been wondering why I'm getting crappy results with cosine similarity distance, and here it was.. at the very core

Those were the worst LLM hallucinations ever seen, I was asking about phone cases and it was responding with pet food items 😆

@dranikpg dranikpg merged commit 30d02a0 into dragonflydb:main Nov 18, 2023
7 checks passed
@dranikpg dranikpg deleted the fix-search-bigs branch December 2, 2023 16:46
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