-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat: cosine_similarity
function
#2680
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it out, and it worked nicely.
I don't fully understand why two equivalent vectors gives me 5.9604645e-8 instead of 0.0 (as shown in the tests), but I understand that this is upstream behaviour and I lack some prior art/experience.
yeah i think this is just a math/precision thing when performing similarity. |
@tychoish the CI seems to keep getting stuck on https://github.com/GlareDB/glaredb/actions/runs/8008291239/job/21874514119?pr=2680 |
adds new function
cosine_similarity
for comparing similarity across floating point vectors.cosine_similarity
is commonly used in vector search workloads.