-
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
Distance metrics integration #422
Conversation
Please add a bit more context for this change in the PR description and link to the respective shortcut issue. |
…arch into vlad/distancemetrics
Fixed inner product ordering
generalize metric handling logic to index.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also add C++ unit tests for this? Specifically that we can set and get the metadata correctly, both during index creation and after writing to a URI. Note that you can just add checks to existing tests, you probably don't need totally new test cases here.
0032183
to
53410b6
Compare
Added two new distance metrics to the FLAT index.
Usage: in create() or ingest(), distance_metric can be specified like this:
distance_metric=vspy.DistanceMetric.COSINE
or
distance_metric=vspy.DistanceMetric.INNER_PRODUCT
Default distance metric is L2.
Note: the Inner Product distance metric returns -dot(a,b) as to provide the vectors in the order indicating highest similarity, without changing the paradigm that "distances" are returned in increasing order.