hora icon indicating copy to clipboard operation
hora copied to clipboard

Dot production is not acting as a distance

Open generall opened this issue 4 years ago • 1 comments

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

generall avatar Jan 09 '22 22:01 generall

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 ?

RXminuS avatar Jan 17 '22 12:01 RXminuS