Skip to content

Commit

Permalink
Fix order of ground truth
Browse files Browse the repository at this point in the history
Updated 'dis' to distance from calcuation.
Sort id based on distance, where nearest neighbor will have lesser
distance than farther neightbor.

Signed-off-by: Vijayan Balasubramanian <[email protected]>
  • Loading branch information
VijayanB committed Jan 3, 2024
1 parent d6717e8 commit a3570c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions benchmarks/perf-tool/compute-ground-truth.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ def query_task_only_vector_search(train_vectors, trained_dis_vector, hdf5Data_te
nearest_indices = np.argpartition(dists, k)[:k]
for idx in nearest_indices:
distances.append({
"dis": 0,
"dis": dists[idx],
"id": idx
})
print("Total time to taken for getting top k neighbors is :", timeit.default_timer() - starttime)
allDistances[i] = distances
sorted_distance = sorted(distances, key=lambda d: d['dis'])
allDistances[i] = sorted_distance
i = i + 1
except:
print(
Expand Down

0 comments on commit a3570c6

Please sign in to comment.