elastiknn icon indicating copy to clipboard operation
elastiknn copied to clipboard

Support for inner product similarity measures (dot product)

Open matt90luo opened this issue 4 years ago • 3 comments

Is there any plan to support inner product similarity measures?

matt90luo avatar May 07 '21 04:05 matt90luo

Is that different from the cosine/angular similarity?

alexklibisz avatar May 07 '21 12:05 alexklibisz

Closing to keep things tidy. Feel free to re-open if you have any followup.

alexklibisz avatar May 16 '21 22:05 alexklibisz

Is that different from the cosine/angular similarity?

Hi, i think that the dot product could be an improvement in performance, and easy to implement. As cosine_similarity(v1,v2) = dot_product(v1/v2)/(||v1|| * ||v2||)

using dot_product simplifies the computation as the magnitude of the vectors are not needed reducing the computation time to 1/3 of the original one, And most of the funcitonality is there

joancf avatar Apr 05 '24 08:04 joancf