Skip to main content

Module normalizer

Module normalizer 

Source
Expand description

Embedding vector normalization utilities.

Provides L2 normalization for dense vectors, ensuring they lie on the unit hypersphere. Required for cosine similarity via dot product.

Functionsยง

cosine_similarity_f32
Compute cosine similarity between two f32 vectors.
dot_product_f32
Compute dot product of two f32 vectors.
l2_norm_f32
Return the L2 norm of a vector.
l2_norm_f64
Return the L2 norm of an f64 vector.
l2_normalize_f32
Normalize a dense vector in-place using L2 normalization.
l2_normalize_f64
Normalize a dense f64 vector in-place using L2 normalization.