
Generate a k-nearest neighbour graph (GPU-accelerated)
generate_knn_graph_gpu.RdThis function generates a kNN graph based on a given numeric matrix. Three different GPU-accelerated versions are available
"exhaustive"- Exact nearest neighbour search via GPU."ivf"- Inverted file index that leverages k-means clustering and probing a few of the clusters via GPU-accelerated distance calculations."nndescent"- A CAGRA style nearest neighbour search on the GPU.
Usage
generate_knn_graph_gpu(
data,
k,
knn_method = c("nndescent", "exhaustive", "ivf"),
nn_params = params_nn_gpu(),
seed = 42L,
extract_knn = lifecycle::deprecated(),
.verbose = TRUE
)Arguments
- data
Numeric matrix. The embedding or feature matrix to compute neighbours on. Rows are observations, columns are features.
- k
Integer. The number of nearest neighbours to compute.
- knn_method
Character. The algorithm to use for nearest neighbour search. One of
c("exhaustive", "ivf", "nndescent"). Defaults to"nndescent"- nn_params
List. Output of
params_nn_gpu().- seed
Integer. For reproducibility. Defaults to
42L.- extract_knn
Use the
extract_knnfield ofparams_nn_gpu()instead.- .verbose
Boolean. Controls verbosity.