-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Is the comment of HNSW::shrink_neighbor_list wrong? #2978
Labels
Comments
Hmmm it looks like you're right. |
OK,here is the PR: #2980 |
facebook-github-bot
pushed a commit
that referenced
this issue
Aug 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/facebookresearch/faiss/blob/821a401ae9ecee7f6b18c5dea70021a88acbc88b/faiss/impl/HNSW.cpp#L225C42-L225C42
I read HNSW::shrink_neighbor_list source very carefully, I'm sure that this comment is wrong. It enumerates vertices from nearest to farthest, not from farthest to nearest.
Here's my analysis:
(1)notice the definition of NodeDistFarther
(2)
It means that the top of input is the node that d is the minimum,and d means the distance。
The smaller the d, the closer the distance(It is also true for inner product metric because d is the opposite of the inner product value)。
(3)Here is a simple test of "std::priority_queue<NodeDistFarther>"
The text was updated successfully, but these errors were encountered: