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

'ProductQuantizer is implemented for L2 only' #3714

Closed
alexanderguzhva opened this issue Aug 1, 2024 · 4 comments
Closed

'ProductQuantizer is implemented for L2 only' #3714

alexanderguzhva opened this issue Aug 1, 2024 · 4 comments

Comments

@alexanderguzhva
Copy link
Contributor

There is a line in ProductQuantizer.h that states the following:

/** Product Quantizer. Implemented only for METRIC_L2 */

@mdouze Would you please explain what this comment means exactly, because it is not clear at all :). Thanks!

@jiajieyao
Copy link

PQDistanceComputer # float symmetric_dis(idx_t i, idx_t j) only support L2 (computer_sdc_table only init L2 sdc table),not support IP

@mdouze
Copy link
Contributor

mdouze commented Aug 5, 2024

The comment is outdated. PQ does support IP search.
The limit is that the k-means training minimizes the L2 distance to centroids, therefore the quantization error is biased towards L2 distance.
It would be possible to implement SDC for IP distances, but we have not seen a use case for it yet.

@jiajieyao
Copy link

review pq code,both training and encode are L2,which explain the ip low recall for sift1M .
why is IP distance not supported,is it a mathematical mechanism problem or have not seen a use case for it yet? thanks @mdouze

facebook-github-bot pushed a commit that referenced this issue Aug 7, 2024
Summary:
Update code comment in response to Alexandr's inquiry

#3714

Differential Revision: D60907205
facebook-github-bot pushed a commit that referenced this issue Aug 8, 2024
Summary:
Pull Request resolved: #3733

Update code comment in response to Alexandr's inquiry

#3714

Reviewed By: mengdilin

Differential Revision: D60907205

fbshipit-source-id: ae0f2c9208b8bafd4343910a3c539fa40985191d
@mnorris11
Copy link

mnorris11 commented Aug 12, 2024

Amir has updated the code comment, so will set this to autoclose unless there are concerns.

ketor pushed a commit to dingodb/faiss that referenced this issue Aug 20, 2024
)

Summary:
Pull Request resolved: facebookresearch#3733

Update code comment in response to Alexandr's inquiry

facebookresearch#3714

Reviewed By: mengdilin

Differential Revision: D60907205

fbshipit-source-id: ae0f2c9208b8bafd4343910a3c539fa40985191d
aalekhpatel07 pushed a commit to aalekhpatel07/faiss that referenced this issue Oct 17, 2024
)

Summary:
Pull Request resolved: facebookresearch#3733

Update code comment in response to Alexandr's inquiry

facebookresearch#3714

Reviewed By: mengdilin

Differential Revision: D60907205

fbshipit-source-id: ae0f2c9208b8bafd4343910a3c539fa40985191d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants