We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae65345 commit 9ab541eCopy full SHA for 9ab541e
src/distance/binary_quantized_euclidean.rs
@@ -75,5 +75,7 @@ impl Distance for BinaryQuantizedEuclidean {
75
}
76
77
fn dot_product(u: &UnalignedVector<BinaryQuantized>, v: &UnalignedVector<BinaryQuantized>) -> f32 {
78
+ // /!\ If the number of dimensions is not a multiple of the `Word` size, we'll xor 0 bits at the end, which will generate a lot of 1s.
79
+ // This may or may not impact relevancy since the 1s will be added to every vector.
80
u.as_bytes().iter().zip(v.as_bytes()).map(|(u, v)| (u ^ v).count_ones()).sum::<u32>() as f32
81
0 commit comments