Skip to content
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

Returning Duplicate Neighbors #68

Open
ArmanJR opened this issue Jun 30, 2024 · 0 comments
Open

Returning Duplicate Neighbors #68

ArmanJR opened this issue Jun 30, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ArmanJR
Copy link

ArmanJR commented Jun 30, 2024

It's weird, but I get completely different results when running the first example of the documentation:

import numpy as np
from voyager import Index, Space

# Create an empty Index object that can store vectors:
index = Index(Space.Euclidean, num_dimensions=5)
id_a = index.add_item([1, 2, 3, 4, 5])
id_b = index.add_item([6, 7, 8, 9, 10])

print(id_a)  # => 0
print(id_b)  # => 1

# Find the two closest elements:
neighbors, distances = index.query([1, 2, 3, 4, 5], k=2)
print(neighbors)  # => [0, 1]
print(distances)  # => [0.0, 125.0]
0
1
[0 0]
[0. 0.]

It seems when querying, a neighbor is being considered more than once.
My device is Mac M1Pro, Python 3.12.

@markkohdev markkohdev added the bug Something isn't working label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants