
Wrapper function to generate GPU nearest neighbour parameters
params_nn_gpu.RdWrapper function to generate GPU nearest neighbour parameters
Usage
params_nn_gpu(
dist_metric = c("euclidean", "cosine"),
n_list = NULL,
n_probes = NULL,
node_degree_final = NULL,
k_build = NULL,
n_tree = NULL,
delta = 0.001,
rho = NULL,
beam_width = NULL,
max_beam_iters = NULL,
n_entry_points = NULL,
extract_knn = FALSE
)Arguments
- dist_metric
String. The distance metric to use. One of
c("euclidean", "cosine"). Defaults to"euclidean".- n_list
Integer or
NULL. IVF GPU: Number of clusters to use. IfNULL, will default tosqrt(n). Defaults toNULL.- n_probes
Integer or
NULL. IVF GPU: Number of clusters to probe. IfNULL, will default tosqrt(n_list). Defaults toNULL.- node_degree_final
Integer or
NULL. Final node degree of the CAGRA navigational graph. IfNULL, defaults to30on the Rust side. Defaults toNULL.- k_build
Integer or
NULL. Number of k-neighbours during the NNDescent build phase before CAGRA pruning. IfNULL, defaults to1.5 * node_degree_finalon the Rust side. (Cannot be smaller thannode_degree_final) Defaults toNULL.- n_tree
Integer or
NULL. CAGRA GPU: Number of trees for graph build. Automatically ifNULL. Defaults toNULL.- delta
Numeric. CAGRA GPU: Early termination parameter for NN descent. Defaults to
0.001.- rho
Numeric or
NULL. CAGRA GPU: Sample rate parameter for NN descent. Defaults toNULL.- beam_width
Integer or
NULL. CAGRA GPU: Beam width for beam search. If not provided will be set tomax(c(k, node_degree_final, 16L)) * 2. Defaults toNULL.- max_beam_iters
Integer or
NULL. CAGRA GPU: Maximum number of beam search iterations. If not provided, defaults to3 * beam_width. Defaults toNULL.- n_entry_points
Integer or
NULL. CAGRA GPU: Number of entry points for beam search. If not provided, defaults to8L. Defaults toNULL.- extract_knn
Boolean. CAGRA GPU: Skip the beam search and take the graph the NNDescent left it. Faster, slightly lower recall. Ignored by the other two searches. Defaults to
FALSE.
Value
A named list with the following elements:
dist_metric - String. The distance metric to use. One of
c("euclidean", "cosine"). Defaults to"euclidean".n_list - Integer or
NULL. IVF GPU: Number of clusters to use. IfNULL, will default tosqrt(n). Defaults toNULL.n_probes - Integer or
NULL. IVF GPU: Number of clusters to probe. IfNULL, will default tosqrt(n_list). Defaults toNULL.node_degree_final - Integer or
NULL. Final node degree of the CAGRA navigational graph. IfNULL, defaults to30on the Rust side. Defaults toNULL.k_build - Integer or
NULL. Number of k-neighbours during the NNDescent build phase before CAGRA pruning. IfNULL, defaults to1.5 * node_degree_finalon the Rust side. (Cannot be smaller thannode_degree_final) Defaults toNULL.n_tree - Integer or
NULL. CAGRA GPU: Number of trees for graph build. Automatically ifNULL. Defaults toNULL.delta - Numeric. CAGRA GPU: Early termination parameter for NN descent. Defaults to
0.001.rho - Numeric or
NULL. CAGRA GPU: Sample rate parameter for NN descent. Defaults toNULL.beam_width - Integer or
NULL. CAGRA GPU: Beam width for beam search. If not provided will be set tomax(c(k, node_degree_final, 16L)) * 2. Defaults toNULL.max_beam_iters - Integer or
NULL. CAGRA GPU: Maximum number of beam search iterations. If not provided, defaults to3 * beam_width. Defaults toNULL.n_entry_points - Integer or
NULL. CAGRA GPU: Number of entry points for beam search. If not provided, defaults to8L. Defaults toNULL.extract_knn - Boolean. CAGRA GPU: Skip the beam search and take the graph the NNDescent left it. Faster, slightly lower recall. Ignored by the other two searches. Defaults to
FALSE.