Created
August 31, 2020 07:57
-
-
Save mdouze/93edbc5cf08a122a08decdfb39cd6d1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import faiss | |
import numpy as np | |
tab = {} | |
for i in range(10**6): | |
print(f'i={i} RSS={faiss.get_mem_usage_kb()} kB', end='\n' if i % 200 == 0 else '\r', flush=True) | |
quant = faiss.IndexFlatL2(32) | |
index = faiss.IndexIVFPQ(quant, 32, 100, 4, 4) | |
x = np.random.rand(5000, 32).astype('float32') | |
index.train(x) | |
index.add(x) | |
tab[50] = index |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment