Hierarchical Navigable Small Worlds
zilliz.com
Hierarchical Navigable Small Worlds
1–10 of 10 posts
Re: Hierarchical Navigable Small Worlds
#2Like this ChatGPT-looking function
nns = [best]
visit = set(best) # set of visited nodes
candid = [best] # candidate nodes to insert into nearest neighbors
# find top-k nearest neighbors
while candid:
cv = heappop(candid)
if nns[-1][0] ef:
nns.pop()
code could have been trivially cleaned up and it would have been so much easier to follow. I'm guessing what some of these variables are supposed to mean. nearest_neighbors = [best]
visited = set(best)
candidates = [best]
# find top-k nearest neighbors
while candidates:
candidate_vector = heappop(candidates)
if nearest_neighbors[-1][0] epsilon:
nearest_neighbors.pop()Re: Hierarchical Navigable Small Worlds
#3Kinda wish they would use some more letters when writing the sample code. This terse style in general is fine but when the purpose of the code is to try to explain how something works, it's adding an extra layer of difficulty decoding what the heck 'nns, 'cv', 'd', 'e' and 'ef' is supposed to mean. Like this ChatGPT-looking function nns = [best] visit = set(best) # set of visited nodes candid = [best] # candidate nod…
Re: Hierarchical Navigable Small Worlds
#4Kinda wish they would use some more letters when writing the sample code. This terse style in general is fine but when the purpose of the code is to try to explain how something works, it's adding an extra layer of difficulty decoding what the heck 'nns, 'cv', 'd', 'e' and 'ef' is supposed to mean. Like this ChatGPT-looking function nns = [best] visit = set(best) # set of visited nodes candid = [best] # candidate nod…
Good suggestion! Actually the "ef" is not epsilon. It is a parameter of the HNSW index: https://github.com/nmslib/hnswlib/blob/master/ALGO_PARAMS.md...
ef being "epsilon factor" was the least nonsensical thing I could come up with since it looked analogous to how you do like abs(a-b)<epsilon in floating point comparisons.
Re: Hierarchical Navigable Small Worlds
#5Earlier quoted context omitted.
Good suggestion! Actually the "ef" is not epsilon. It is a parameter of the HNSW index: https://github.com/nmslib/hnswlib/blob/master/ALGO_PARAMS.md...
Yeah it wasn't referenced or mentioned anywhere in the article so I had to guess what it was :-/ ... which I guess supports my point. ef being "epsilon factor" was the least nonsensical thing I could come up with since it looked analogous to how you do like abs(a-b)<epsilon in floating point comparisons.
Re: Hierarchical Navigable Small Worlds
#6Earlier quoted context omitted.
Yeah it wasn't referenced or mentioned anywhere in the article so I had to guess what it was :-/ ... which I guess supports my point. ef being "epsilon factor" was the least nonsensical thing I could come up with since it looked analogous to how you do like abs(a-b)<epsilon in floating point comparisons.
Hm... adding links in code comment might be better.
I think in this scenario when the primary audience of the code isn't an interpreter, but people who don't understand HNSWs, and who will probably only glance over the code once or twice, you really can't lay on the verbosity heavily enough.
Re: Hierarchical Navigable Small Worlds
#7We use it for searching aftermarket domains on Instant Domain Search.
Re: Hierarchical Navigable Small Worlds
#8Re: Hierarchical Navigable Small Worlds
#9Why have a cookie dialog if my only option is to "accept"? Not much of a dialog there.
Re: Hierarchical Navigable Small Worlds
#10Why have a cookie dialog if my only option is to "accept"? Not much of a dialog there.
probably required by some laws
You need to obtain consent before you set any marketing cookies and effective consent can’t be obtained if your only option is “yeah track me”