From bad72bb79f3a802a7e133d547a5632df9ec22e62 Mon Sep 17 00:00:00 2001 From: Amey Varhade Date: Thu, 24 Oct 2024 11:10:55 +0530 Subject: [PATCH] randomized start point --- apps/search_memory_index.cpp | 5 +- apps/utils/compute_groundtruth.cpp | 17 +- results/R64_k10_l100.txt | 36782 -------------------------- results/R64_k1_l100.txt | 36846 -------------------------- results/R64_k50_l100.txt | 36904 --------------------------- src/index.cpp | 60 +- 6 files changed, 34 insertions(+), 110580 deletions(-) delete mode 100644 results/R64_k10_l100.txt delete mode 100644 results/R64_k1_l100.txt delete mode 100644 results/R64_k50_l100.txt diff --git a/apps/search_memory_index.cpp b/apps/search_memory_index.cpp index 5df59dded..2138b9134 100644 --- a/apps/search_memory_index.cpp +++ b/apps/search_memory_index.cpp @@ -145,7 +145,8 @@ int search_memory_index(diskann::Metric &metric, const std::string &index_path, double best_recall = 0.0; for (uint32_t test_id = 0; test_id < Lvec.size(); test_id++) - { + { + std::cout<<"L: "<>> processUnfilteredParts(cons std::vector &location_to_tag) { float *base_data = nullptr; - //std::cout<<"AMEY: Inside processUnfilteredParts location_to_tag "<(base_file.c_str()); std::vector>> res(nqueries); for (int p = 0; p < num_parts; p++) @@ -393,20 +392,13 @@ int aux_main(const std::string &base_file, const std::string &query_file, const // load tags const bool tags_enabled = tags_file.empty() ? false : true; - //const bool base_file_exists = base_file.empty() ? false : true; - //std::cout<<"AMEY: base_file_exists "< location_to_tag = diskann::loadTags(tags_file, base_file); int *closest_points = new int[nqueries * k]; float *dist_closest_points = new float[nqueries * k]; - //std::cout<<"AMEY: Inside aux_main location_to_tag "<>> results = processUnfilteredParts(base_file, nqueries, npoints, dim, k, query_data, metric, location_to_tag); - //std::cout<<"AMEY: in aux_main after processUnfiltered "< std::vector Inde } } - if(_nd > 1000){ - std::random_device rd; - std::mt19937 gen(rd()); - std::uniform_int_distribution<> dis(0, _nd-1); - for(uint32_t i=0;i<1000;i++){ - init_ids.emplace_back(dis(gen)); - } - } + // if(_nd > 50000){ + // std::random_device rd; + // std::mt19937 gen(rd()); + // std::uniform_int_distribution dis(0, (uint32_t)_nd-1); + // for(uint32_t i=0;i<1000;i++){ + // init_ids.emplace_back((uint32_t)dis(gen)); + // } + // } return init_ids; } @@ -893,14 +893,14 @@ std::pair Index::iterate_to_fixed_point( auto nbr = best_L_nodes.closest_unexpanded(); auto n = nbr.id; - if(search_invocation){ - std::vector id_scratch_temp = {n}; - std::vector dist_scratch_temp = {0.0}; - compute_dists(id_scratch_temp, dist_scratch_temp); - diskann::cout<<"Iteration/Hop: #"< id_scratch_temp = {n}; + // std::vector dist_scratch_temp = {0.0}; + // compute_dists(id_scratch_temp, dist_scratch_temp); + // diskann::cout<<"Iteration/Hop: #"< Index::iterate_to_fixed_point( compute_dists(id_scratch, dist_scratch); cmps += (uint32_t)id_scratch.size(); - // Insert pairs into the pool of candidates - if (search_invocation){ - diskann::cout<<"Comparisons(Neighbors of ID) "<<(uint32_t)id_scratch.size()< pairs into the pool of candidates + // if (search_invocation){ + // diskann::cout<<"Comparisons(Neighbors of ID) "<<(uint32_t)id_scratch.size()<get_distance(id_scratch[m], n); - diskann::cout<<"pt #"<get_distance(id_scratch[m], n); + // diskann::cout<<"pt #"<expanded_nodes_vec().size()<expanded_nodes_vec()){ - diskann::cout<expanded_nodes_vec().size()<expanded_nodes_vec()){ + // diskann::cout<