Closed xjj210130 closed 2 years ago
i use m_ptrModel->nprobe =1, or not use m_ptrModel->nprobe the score is also different
The python code calls the C++ implementation, so I don't see how they could be different.
Thanks.,maybe the different is The accuracy loss at that point is due to just the PQ compression. Analyzing accuracy issues with IndexIVFPQ
Summary
hi all: m_ptrIndexFlatL2 = std::make_unique(m_dim);
m_ncentroids = 100;//int(4 sqrt(m_total));
faiss::IndexIVFPQ m_ptrModel = new faiss::IndexIVFPQ(m_ptrIndexFlatL2.get(), 64, 100, 8, 8);
m_ptrModel->train(m_total, m_ptrData.get());
m_ptrModel->add(m_total, m_ptrData.get());i build index as following:
search as following: std::unique_ptr pxI(new idx_t[nk]);
idx_t I= pxI.get();
The python build index para is the same:
quantizer = faiss.IndexFlatL2(dim)
faiss.IndexIVFPQ(quantizer, 64, 100, 8, 8)however, use the same data to build index.the result is different: python: id : 1453739546047295488 score: 0.22 c++ : id:"1453739546047295488" score:4.4158867e-05
Platform
OS: linux Faiss version:
Installed from:
Faiss compilation options:
Running on:
Interface:
[ ] C++ c++ : id:"1453739546047295488" score:4.4158867e-05
[ ] Python python: id : 1453739546047295488 score: 0.22
Reproduction instructions
The result is different.