Comments (5)
Hi @rafael-aero,
You can access the data by using the method char *getDataByInternalId(tableint internal_id)
which returns the pointer to the first element in the vector. To get an internal ID of an element you should store the result of HNSW's addPoint(void *data_point, labeltype label, int level)
.
Right now the element's internal IDs never change. But this probably might be changed in the future.
from hnswlib.
awesome, thanks for the super quick reply 👍
I'll keep in mind for future versions to check if this is still the case.
from hnswlib.
Is there a way of doing this with the python bindings?
The method nmslib.getDataPoint(index, i) doesn't seem to work if you are loading a previously saved index. Executing nmslib.getDataPointQty(index) returns 0 even if the data is loaded (as index.knnQuery does return results).
from hnswlib.
@glennkroegel Shouldn't be so. I'll look into it.
from hnswlib.
@glennkroegel It seems that you are referencing nmslib, not hnswlib. hnswlib has a different function with similar functionality (get_items
). It also should work after saving/loading the index without any problems.
In nmslib's hnsw you need to reload all elements separately from loading the index itself in order to access them (hope @searchivarius will correct me if I am wrong). This is because hnsw in nmslib is using its own data structures.
from hnswlib.
Related Issues (20)
- ability to have a custom distance function
- Question : Implementing disk paging for index larger than memory
- Question: Single vs. Multiple HNSW Graphs for Nearest Neighbor Searches Across Multiple Companies? HOT 1
- Error: ‘_mm512_reduce_add_ps’ was not declared in this scope HOT 1
- CMakeLists needs a fix for some hardcoded flags HOT 2
- Question: Is index build time unstable? HOT 2
- Sharing: Single vs Multiple HNSW graph && Impact of parameters on HNSW search
- Purpose of label_lookup_ HOT 1
- InnerProduct possible BUG: 1.0 - sum(x * y). In faiss and milvus, its just sum(x * y)
- Illegal instruction (core dumped) when importing hnswlib HOT 1
- The IP space [1.0 - sum(AiBi)] might be inaccurate. Why not separate the IP from the cosine, and define the IP simply as [- sum(AiBi)]? HOT 1
- Loaded index query error
- Normalization of CLIP Vectors Before Storing in Milvus for Cosine Similarity HOT 1
- About checkIntegrity HOT 1
- How do I use hnswlib for ColBERT's set of vectors? HOT 1
- Regarding the identification of elements with a high contribution rate in the inspection vector.
- Is simultaneous querying and inserting thread-safe? HOT 2
- Correlation of `M`, `k` and `number of items` in the index HOT 1
- Illegal instruction (core dumped) when load_index HOT 1
- stream load. Is it possible? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hnswlib.