@mdouze
How do I get the value of IVF centroids from a trained IndexIVFPQ file with python?
I have tried index_ivfpq.quantizer.xb and index_ivfpq.xb.
Could you help me out?
Thanks a lot!
_Originally posted by @BeginnerW in https://github.com/facebookresearch/faiss/issues/933#issuecomment-534513733_
You can do it with
import numpy as np
import faiss
x = np.random.rand(10000, 32).astype('float32')
index = faiss.index_factory(32, "IVF100,PQ4np")
index.train(x)
centroids = index.quantizer.reconstruct_n(0, index.nlist)
no activity, closing.
Most helpful comment
You can do it with