Skip to content

hj-n/gpu-knn-snn-graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 (knnsnn.py), 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 knnsnn.py 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 test.py to know the way to use knnsnn.py in detail.

About

k-nearest neighbor and Shared-nearest neighbors graph construction on GPU (with pycuda + faiss)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages