Hi, I use reconstruct() to get a vector from index, I get the right answer with indexFlatL2 and indexIVFFlat, but with indexIVFPQ, the vector I got is not the same as before when I put same index. How could I use reconstruct() for indexIVFPQ?
IndexIVFPQ uses product quantization to lossily compress the vector, so reconstruct() is returning the quantized representation of the vector (it is "reconstructed" from the data present in the index). The vector you added appears to the index in the form that reconstruct() returns.
IVFFlat and Flat store vector data without compression, so it makes sense that those are returning the vector that you had originally.
Hi, I use reconstruct() to get a vector from index, I get the right answer with indexFlatL2 and indexIVFFlat, but with indexIVFPQ, the vector I got is not the same as before when I put same index. How could I use reconstruct() for indexIVFPQ?
hi,Buddy. I have the problem when I use reconstruct(). Index already created by indexIVFFlat that has the hash ids. The error is :+1: RuntimeError: Error in virtual void faiss::IndexIVF::reconstruct(faiss::Index::idx_t, float*) const at IndexIVF.cpp:191: Error: 'direct_map.size() == ntotal' failed: direct map is not initialized
Most helpful comment
IndexIVFPQ uses product quantization to lossily compress the vector, so reconstruct() is returning the quantized representation of the vector (it is "reconstructed" from the data present in the index). The vector you added appears to the index in the form that reconstruct() returns.
IVFFlat and Flat store vector data without compression, so it makes sense that those are returning the vector that you had originally.