@@ -109,6 +109,11 @@ def get_entry_vertex_indices(self) -> List[int]:
109
109
def has_path (self , entry_vertex_indices : List [int ], to_vertex : int , eps : float , k : int ) -> List [ObjectDistance ]:
110
110
"""
111
111
Returns a path from one of the entry vertex indices to the given to_vertex.
112
+
113
+ :param entry_vertex_indices: List of start vertices
114
+ :param to_vertex: The vertex to find a path to
115
+ :param eps: Controls how many nodes are checked during search. Lower eps values like 0.001 are faster but less
116
+ accurate. Higher eps values like 0.1 are slower but more accurate. Should always be greater 0.
112
117
"""
113
118
raise NotImplementedError ()
114
119
@@ -126,15 +131,19 @@ def search(
126
131
extended the search range.
127
132
128
133
:param query: A feature vector for which similar feature vectors should searched.
129
- :param eps: TODO
134
+ :param eps: Controls how many nodes are checked during search. Lower eps values like 0.001 are faster but less
135
+ accurate. Higher eps values like 0.1 are slower but more accurate. Should always be greater 0.
130
136
:param k: The number of results that will be returned
131
137
:param max_distance_computation_count: Limit the number of distance calculations. If set to 0 this is ignored.
132
138
:param entry_vertex_indices: Start point for exploratory search. If None, a reasonable default is used.
133
139
:param threads: The number of threads to use for parallel processing. It should not excel the number of queries.
134
140
If set to 0, the minimum of the number of cores of this machine and the number of queries is
135
141
used.
136
142
:param thread_batch_size: If threads != 1, the number of queries to search in the same thread.
137
- :returns: TODO
143
+ :returns: A tuple containing (indices, distances) where indices is a numpy-array of shape [n_queries, k]
144
+ containing the indices to the closest found neighbors to the queries.
145
+ Distances is a numpy-array of shape [n_queries, k] containing the distances to the closest found
146
+ neighbors.
138
147
"""
139
148
# handle query shapes
140
149
if len (query .shape ) == 1 :
@@ -160,11 +169,11 @@ def search(
160
169
@abstractmethod
161
170
def explore (self , entry_vertex_index : int , k : int , max_distance_computation_count : int ) -> ResultSet :
162
171
"""
163
- A exploration for similar element, limited by max_distance_computation_count
172
+ An exploration for similar element, limited by max_distance_computation_count
164
173
165
174
:param entry_vertex_index: The start point for which similar feature vectors should be searched
166
175
:param k: The number of similar feature vectors to return
167
- :param max_distance_computation_count: TODO
176
+ :param max_distance_computation_count: Limit the number of distance calculations. If set to 0 this is ignored.
168
177
"""
169
178
raise NotImplementedError ()
170
179
@@ -217,7 +226,6 @@ def get_feature_space(self) -> FloatSpace:
217
226
# first two parameters get ignored
218
227
return FloatSpace (float_space_cpp = self .graph_cpp .get_feature_space ())
219
228
220
-
221
229
def get_internal_index (self , external_label : int ) -> int :
222
230
"""
223
231
Translates internal index to external label
@@ -233,7 +241,8 @@ def has_path(self, entry_vertex_indices: List[int], to_vertex: int, eps: float,
233
241
234
242
:param entry_vertex_indices: List of start vertices
235
243
:param to_vertex: The vertex to find a path to
236
- :param eps: TODO
244
+ :param eps: Controls how many nodes are checked during search. Lower eps values like 0.001 are faster but less
245
+ accurate. Higher eps values like 0.1 are slower but more accurate. Should always be greater 0.
237
246
:param k: TODO
238
247
"""
239
248
return [ObjectDistance (od ) for od in self .graph_cpp .has_path (entry_vertex_indices , to_vertex , eps , k )]
@@ -465,7 +474,8 @@ def has_path(self, entry_vertex_indices: List[int], to_vertex: int, eps: float,
465
474
466
475
:param entry_vertex_indices: List of start vertices
467
476
:param to_vertex: The vertex to find a path to
468
- :param eps: TODO
477
+ :param eps: Controls how many nodes are checked during search. Lower eps values like 0.001 are faster but less
478
+ accurate. Higher eps values like 0.1 are slower but more accurate. Should always be greater 0.
469
479
:param k: TODO
470
480
"""
471
481
return [ObjectDistance (od ) for od in self .graph_cpp .has_path (entry_vertex_indices , to_vertex , eps , k )]
0 commit comments