球树算法有一种方法“查询”来查找最近的向量。
编码:
o_i = 100
f_dist, f_ind = f_tree.query(np.asarray(vec), k=o_i) # the vec is the query vector, f_tree is the tree object,
但是这里的输出是所需的向量数量,即o_i
,我想获得查询图像所属的叶节点中存在的所有向量数量的输出,算法执行近似最近搜索。
球树算法有一种方法“查询”来查找最近的向量。
编码:
o_i = 100
f_dist, f_ind = f_tree.query(np.asarray(vec), k=o_i) # the vec is the query vector, f_tree is the tree object,
但是这里的输出是所需的向量数量,即o_i
,我想获得查询图像所属的叶节点中存在的所有向量数量的输出,算法执行近似最近搜索。