Skip to content

fix(kmeans): correct spherical centroid normalization - #654

Merged
egolearner merged 2 commits into
alibaba:mainfrom
egolearner:fix/spherical_kmeans
Aug 5, 2026
Merged

fix(kmeans): correct spherical centroid normalization#654
egolearner merged 2 commits into
alibaba:mainfrom
egolearner:fix/spherical_kmeans

Conversation

@egolearner

Copy link
Copy Markdown
Collaborator

Summary

Fix spherical K-means behavior for floating-point vectors by ensuring that
centroids are L2-normalized after each Lloyd iteration

Motivation

The previous Norm2 overloads selected the non-normalizing fallback for
floating-point contexts, leaving spherical centroids unnormalized.

@egolearner
egolearner force-pushed the fix/spherical_kmeans branch from e6d3f9e to 605fe74 Compare August 5, 2026 03:10

@richyreachy richyreachy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@egolearner
egolearner merged commit d7a95d0 into alibaba:main Aug 5, 2026
13 checks passed
@egolearner
egolearner deleted the fix/spherical_kmeans branch August 5, 2026 04:48
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.

3 participants