You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As i looked around on the documentation for Python SDK, custom metrics having more than 2 variables are not shown how to perform search() operation. Specifically, when using masked-L2 metric, at run time (after indexing the vectors) one might need a query vector and a binary mask, as can be seen in this function:
def masked_l2_distance(a, b, mask):
a_array = carray(a, dims)
b_array = carray(b, dims)
mask_array = carray(mask, dims)
distance = 0.0
for i in range(dims):
if mask_array[i]:
diff = a_array[i] - b_array[i]
distance += diff * diff
return distance
How do I plug in the query vector and its binary mask to perform the search?
Can you contribute to the implementation?
I can contribute
Is your feature request specific to a certain interface?
Python bindings
Contact Details
No response
Is there an existing issue for this?
I have searched the existing issues
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
lnmduc2
changed the title
Feature: Add documentation regarding how to search with custom metrics with more than two variables
Feature: Add Python documentation regarding how to search with custom metrics with more than two variables
Jul 22, 2024
As i looked around on the documentation for Python SDK, custom metrics having more than 2 variables are not shown how to perform search() operation. Specifically, when using masked-L2 metric, at run time (after indexing the vectors) one might need a query vector and a binary mask, as can be seen in this function:
How do I plug in the query vector and its binary mask to perform the search?
Can you contribute to the implementation?
Is your feature request specific to a certain interface?
Python bindings
Contact Details
No response
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: