Open 2673380801 opened 4 months ago
Search should be deterministic. Construction is not deterministic if using more than a single thread
Search should be deterministic. Construction is not deterministic if using more than a single thread
thanks for your reply
Search should be deterministic. Construction is not deterministic if using more than a single thread
Search should be deterministic. Construction is not deterministic if using more than a single thread
I tried setting only one thread, but the results are still different every time
Hm. That is strange. Is the data order is the same?
Hm. That is strange. Is the data order is the same?
the data order is the same.I used hnswlib in python. I tried calculating mutual nearest neighbors, but each time the same group of data is calculated, the quantity is different.
Hm. That is strange. Is the data order is the same?
here is the code:
dim = dataset2.shape[1]
num_elements = dataset2.shape[0]
tree = hnswlib.Index(space="cosine", dim=dim)
tree.init_index(max_elements=num_elements, ef_construction=200, M=16)
tree.set_ef(50)
tree.set_num_threads(1)
tree.additems(dataset2)
ind, = tree.knn_query(dataset1, k=knn,num_threads =1)
How can I ensure consistent results every time I run the code? I get different results each time I run the code