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

feat: add cosine_distance for vector similarity compute #10737

Merged
merged 13 commits into from
Mar 24, 2023

Conversation

BohuTANG
Copy link
Member

@BohuTANG BohuTANG commented Mar 23, 2023

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

This pull request introduces a new cosine_distance function, which takes two input vectors, from and to, represented as slices of f32 values.

The function calculates the cosine distance between the two vectors and returns a Result type. If the input vectors have unequal lengths, the function returns an Err variant with an InvalidArgument error code, indicating that the lengths are not equal.

The implementation utilizes the ArrayView type from the ndarray library for efficient calculations.

Part #10689

@vercel
Copy link

vercel bot commented Mar 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
databend ⬜️ Ignored (Inspect) Visit Preview Mar 24, 2023 at 10:48AM (UTC)

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label Mar 23, 2023
@BohuTANG BohuTANG force-pushed the dev-vector-distance branch from b2454e6 to 6232259 Compare March 23, 2023 14:41
@BohuTANG
Copy link
Member Author

@mergify update

@mergify
Copy link
Contributor

mergify bot commented Mar 24, 2023

update

☑️ Nothing to do

  • #commits-behind>0 [:pushpin: update requirement]
  • -closed [:pushpin: update requirement]

@BohuTANG
Copy link
Member Author

@mergify update

@mergify
Copy link
Contributor

mergify bot commented Mar 24, 2023

update

✅ Branch has been successfully updated

@BohuTANG BohuTANG marked this pull request as ready for review March 24, 2023 11:18
@BohuTANG BohuTANG requested a review from b41sh March 24, 2023 11:19
@BohuTANG BohuTANG merged commit 0a3969a into databendlabs:main Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants