FALCONN
FALCONN copied to clipboard
Is it possible to return distance using find_k_nearest_neighbors() function?
Hi @ludwigschmidt, I find the find_k_nearest_neighbors() function only returns the index of the search result, with no distance returned. Is it possible to return distance using find_k_nearest_neighbors() function?
Looking forward to your reply.
Thanks.
Currently we don't return distances in find_k_nearest_neighbors (or any other method). We made that decision because it is not hard to compute the distances for a given set of point indices outside FALCONN. Since we do compute the distances internally, we would have that information. For a future version, it would be good to change the function interfaces so that they optionally also return distances.
@ludwigschmidt Yeah, I have noticed the library compute the distances internally, and it will be great to return the distances in future version.
By the way, the current version does not support the dynamic data. So for a outer data point, it can't insert to the built index. nmslib and mrpt also face the problem. LSH is a data-dependent hashing method, does the problem can be solved by saving the hashing functions, so for a new (outer) data, it can be encoding by the hashing functions.
The hash functions used in FALCONN at the moment are not data dependent. Adding a dynamic data structure is on the TODO list (see issue #2 ).
@ludwigschmidt Hi, could you give the update about how's adding a dynamic data structure going on now?
i also need a dynamic data structure, for examples, dataset could be appended. currently, LSHIndex had a function "setup", if dataset changed, need recall function "setup", it need lots of time