Skip to content

Commit

Permalink
Modify the string of hnswlib's parameters to add efQuery (#562)
Browse files Browse the repository at this point in the history
* Modify the string of hnswlib's parameters to add efQuery

* Removed commented out code.

---------

Co-authored-by: Martin Aumüller <maau@itu.dk>
  • Loading branch information
guangzegu and maumueller authored Jan 17, 2025
1 parent 0e32628 commit 75a9c61
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ann_benchmarks/algorithms/hnswlib/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ def __init__(self, metric, method_param):
self.metric = {"angular": "cosine", "euclidean": "l2"}[metric]
self.method_param = method_param
# print(self.method_param,save_index,query_param)
# self.ef=query_param['ef']
self.name = "hnswlib (%s)" % (self.method_param)

def fit(self, X):
# Only l2 is supported currently
Expand All @@ -24,6 +22,7 @@ def fit(self, X):

def set_query_arguments(self, ef):
self.p.set_ef(ef)
self.name = "hnswlib (%s, 'efQuery': %s)" % (self.method_param, ef)

def query(self, v, n):
# print(np.expand_dims(v,axis=0).shape)
Expand Down

0 comments on commit 75a9c61

Please sign in to comment.