Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why did faiss.ProductQuantizer() get an incorrect result? #60

Closed
yuleung opened this issue Jun 25, 2022 · 1 comment
Closed

why did faiss.ProductQuantizer() get an incorrect result? #60

yuleung opened this issue Jun 25, 2022 · 1 comment

Comments

@yuleung
Copy link

yuleung commented Jun 25, 2022

code:
import numpy as np
import faiss

ver = np.random.randn(1000,512)
ver = ver .astype(np.float32)
print(ver .shape)
pq = faiss.ProductQuantizer(512, 4, 3) #dim:512 seg:4 bit:3
pq.train(ver)
codes = pq.compute_codes(ver)
print(codes.shape)
print(codes)

result: #got seg:2
(1000, 512)
(1000, 2)
[[ 58 5]
[ 62 7]
[ 63 11]
...
[171 7]
[ 57 7]
[ 92 1]]

@kyamagu
Copy link
Owner

kyamagu commented Jun 25, 2022

@yuleung This repository is merely a build automation for faiss pypi packages. Ask the usage question in the official repository.

@kyamagu kyamagu closed this as completed Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants