hora
hora copied to clipboard
Dot production is not acting as a distance
This line assumes, that dot function returns a simple dot production and negates it to make it work like a distance (smaller = closer)
https://github.com/hora-search/hora/blob/a6759f8ae950a10d833735b9bca82d80435e60aa/src/core/metrics.rs#L56
But in reality, dot function is already negated in the SIMDOptmized inplementation:
https://github.com/hora-search/hora/blob/ce10e42bacbf29163fcb9a973e1a3f9dc528effb/src/core/simd_metrics.rs#L32
Which leads to double inverting and incorrect use of Dot Production
I think this is even causing a panic when using CosineSimilarity (I'm getting an calling Option::unwrap() on a None value) which might be related to #17 ?