GPU implementation of kNN and SNN

  • GPU implementation of $k$-Nearest Neighbors and Shared-Nearest Neighbors
  • Supported by numba cuda and faiss library

Env Initialization & Activation

Prior to the import and execution of main source code (, a conda envrionment should be set. Execute following commands to set the envrionment.

conda env create --file ksnn_env.yaml
conda activate gpu-knn-snn

Import & Execution

Place in the working directory, and import the within class using

from knnsnn import KnnSnn as ks

Afterwards, you can create an instance and runn knn and snn by

KSnn = ks(k)
knn_indices = KSnn.knn(sample_data)
snn_results = KSnn.snn(knn_indices)

Refer to to know the way to use in detail.


View Github