Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
There was an error while loading. Please reload this page.
This Java implementation defines ANGULAR distance as "cosine similarity", while the C++/python implementation defines ANGULAR distance as "approximate theta".
Evidence:
Java implementation -- dot(u,v), the value of cosine
annoy-java/src/main/java/com/spotify/annoy/ANNIndex.java
Line 189 in aef275b
annoy-java/src/main/java/com/spotify/annoy/ANNIndex.java
Line 319 in aef275b
C++ / python implementation -- sqrt(2 * (1 - dot(u,v))), an approximation of theta
https://github.com/spotify/annoy/blob/6f6b0c84ab413337eb4d2e850a4cba637f52ccbc/src/annoylib.h#L473
https://github.com/spotify/annoy/blob/6f6b0c84ab413337eb4d2e850a4cba637f52ccbc/src/annoylib.h#L502
Related issue defining "angular" method in the other repo: spotify/annoy#530
Because this would be a significant breaking change, I did not put a PR together. Would the lead devs provide guidance on the appropriate way to name a new distance that implements angular correctly ("angular-cpp" or "angular-correct"?).