You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
struct NodeDistFarther {
float d;
int id;
NodeDistFarther(float d, int id) : d(d), id(id) {}
bool operator<(const NodeDistFarther& obj1) const {
return d > obj1.d;
}
};
std::priority_queue<NodeDistFarther> input
(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:
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: