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(embeddings): add embedding distance calculator module #142

Merged
merged 7 commits into from
Dec 5, 2024

Conversation

marieaurore123
Copy link
Contributor

@marieaurore123 marieaurore123 commented Dec 4, 2024

  • Creates new module in rig::embeddings::distance which defines the trait VectorDistance. The trait allows for dot, cosine, euclidean, manhattan, angular, and chebyshev distances to be calculated between 2 embedding vectors.
  • The distance calculations use the par_iter function from the crate rayon to parallelize the calculations. Since rayon is a large crate, the distance module is hidden behind the feature: embedding-distance.
  • Changed the cosine similarity equation

@marieaurore123 marieaurore123 changed the title feat: add embedding distance calculator module Feat(embeddings): add embedding distance calculator module Dec 4, 2024
@cvauclair cvauclair merged commit 5979c64 into main Dec 5, 2024
5 checks passed
@github-actions github-actions bot mentioned this pull request Dec 5, 2024
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.

2 participants