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

multiple indices #40

Open
ronsoohyeong opened this issue Jan 2, 2021 · 1 comment
Open

multiple indices #40

ronsoohyeong opened this issue Jan 2, 2021 · 1 comment

Comments

@ronsoohyeong
Copy link

First of all, thanks for sharing your great work as open source.

When I tried to use n2, I found the current n2 v0.1.7 only assumes there is only one index.
For example:
`
num_indices =14

indices =[]
for idx in range(num_indices):
indices.append( HnswIndex(f, "L2"))

num_examples = 1000
for i in range(num_examples):
for idx in range(num_indices):
v = [random.gauss(0, 1) for z in range(f)]
res = indices[idx].add_data(v)

for idx in range(num_indices):
indices[idx].build()

k = 30
for i in range(num_examples):
for idx in range(num_indices):
neighbor_ids = indices[idx].search_by_id(i, k, include_distances =True)
`

Since each index is added with 1000 examples each, the returned ids are supposed to be smaller than 1000 or limited to multiples of 14, but neither was the case.
I am wondering if the support for multiple independent indices is in the future plan.

BR.

@gony-noreply
Copy link
Member

I found the current n2 v0.1.7 only assumes there is only one index.

No, N2 does not assume that.

the returned ids are supposed to be smaller than 1000 or limited to multiples of 14, but neither was the case.

The Ids returned by search_by_id in your case must be smaller than 1000. If not, tell us how to reproduce it(sample executable and reproducible code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants