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: cosine, l2 distance and external build for multilevel kmeans #44

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

usamoi
Copy link
Contributor

@usamoi usamoi commented Nov 4, 2024

No description provided.

@usamoi
Copy link
Contributor Author

usamoi commented Nov 7, 2024

@cutecutecat Can you review this? It changes structure of external build table so that scripts need modification.

@usamoi usamoi changed the title fix: cosine distance and external build for multilevel kmeans fix: cosine, l2 distance and external build for multilevel kmeans Nov 7, 2024
@usamoi usamoi mentioned this pull request Nov 7, 2024
if vector_options.dims != vector.as_borrowed().dims() {
pgrx::error!("extern build: incorrect dimension, id = {id}");
}
vectors.insert(id, rabitq::project(vector.slice()));
Copy link
Member

Choose a reason for hiding this comment

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

For cosine distance, function_normalize() or opfamily.preprocess() is required for centroids.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For cosine distance, function_normalize() or opfamily.preprocess() is required for centroids.

No. This should be done in sampling.

@usamoi usamoi merged commit 784edb8 into main Nov 7, 2024
4 checks passed
@usamoi usamoi deleted the fix branch November 14, 2024 09:14
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