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.