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

create empty index #4

Closed
visr opened this issue Feb 26, 2020 · 3 comments
Closed

create empty index #4

visr opened this issue Feb 26, 2020 · 3 comments

Comments

@visr
Copy link

visr commented Feb 26, 2020

Hi, I just wanted to try out this package. I've used NearestNeigbors.jl before, but need to be able to add and remove points from the tree efficiently.

I want to start with an empty index (nvectors=0) and build it up, but got stuck on this assert:

@assert k <= nvectors "Number of quantization levels has to be <= $nvectors"

Is there a way to do this? I don't know much about these indices and if this would be the right package for the job.

@zgornel
Copy link
Collaborator

zgornel commented Feb 27, 2020

Hi. Not really but feasible. Main point is:

  • the index relies on a coarse quantizer (often just cluster ceters) and a residual quantizer, both learned from data
  • a simple method to build an empty index is to build it and remove all indexed points. The coarse and residual quantizers remain in the object while the points are deleted.
  • there is not straightforward way of incrementally building this type of index and it was never supposed to. The quality depends on the initial indexed data.

@visr
Copy link
Author

visr commented Feb 27, 2020

Ok, thanks the additional information! It seems that this is not the right index for my use case. Good to know!

@visr visr closed this as completed Feb 27, 2020
@zgornel
Copy link
Collaborator

zgornel commented Feb 27, 2020

Yep, seems not. A brutetree from NearestNeighbors might do the job as it is basically brute force NN with a very simple vector of vector structure. For low dimensionalities may be enough...

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