-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing cosine? #51
Comments
@jcoc611 Thank you for having interest in this npm. hnsw-node currently does not support cosine metric. Python bindings normalize vector when before calling the addPoint member function if the normalize flag is true. It is not difficult to do the same in the hnsw-node. I would like to to try to implement the cosine metric option. |
This would be a great addition. We're using this library in https://github.com/hwchase17/langchainjs (thank you!) and would love to offer cosine metric |
@nfcampos Thank you for using this npm for your great product 👍 The cosine metric option has been implemented and tested, I will release that shortly. |
@yoshoku Great, thanks! |
Hi there! This is great.
Seems that
cosine
metric is missing. Based on the python bindings it should be as easy as saving anormalize
flag somewhere inHierarchicalNSW
of addon.cc and using IP + normalizing all the vectors if true.The text was updated successfully, but these errors were encountered: