Commit a685ab26 authored by 蔡宇东's avatar 蔡宇东
Browse files

#527 update ground truth check

parent e3354fd9
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -210,7 +210,8 @@ GetResultHitCount(const faiss::Index::idx_t* ground_index, const faiss::Index::i
    size_t min_k = std::min(ground_k, k);
    int hit = 0;
    for (int i = 0; i < nq; i++) {
        std::set<faiss::Index::idx_t> ground(ground_index + i * ground_k, ground_index + i * ground_k + min_k);
        std::set<faiss::Index::idx_t> ground(ground_index + i * ground_k,
                                             ground_index + i * ground_k + min_k / index_add_loops);
        for (int j = 0; j < min_k; j++) {
            faiss::Index::idx_t id = index[i * k + j];
            if (ground.count(id) > 0) {