Git Product home page Git Product logo

nndescent's Introduction

Nearest Neighbour Descent

see report for background: 52_report.pdf

This is the repository for the Advanced Systems Lab project by:

  • Jonas
  • Tobias
  • Dan
  • Samuel

The goal of the project is to implement NN-Descent which is an efficient algorithm for approximate K-Nearest Neighbour Graph (K-NNG) construction.

The algorithm is described in the pulication "Efficient K-Nearest Neighbor Graph Construction for Generic Similarity Measures" by Wei Dong et al.

Useful links:

Installation

After cloning the repository compile the C-code in the directory nn_descent with the following command:

gcc  -O3 -ffast-math -march=native -o a.out knnd.c knnd_test.c vec.c -lm

Additionally you will have to create a Python virtual environment. To do so you can follow these steps:

  1. create the environment in the chosen path (e.g ./pip-env)
    python -m venv ./pip-env
    
  2. activate the environment source pip-env/bin/activate
  3. install the requirements listed in requirements.txt pip install -r requirements.txt

How-To: Benchmark

Obtain code of nn_descent of in the version you wish to benchmark. Usually this means cloning into a new directory and resetting as follows:

git clone ... 
cd copy_of_project
git reset --hard T0

Don't forget to adjust the frequency constant in the C code.

Run

python benchmark.py -p ../copy_of_project/nn_descent

which will generate a tab separated file in directory benchmarks. Make sure to add an identifier of your architectures to files you wish to push to the repistory.

Plotting

You may find examples of plots in eval_zenv1.ipynb

nndescent's People

Contributors

resulknad avatar

Stargazers

Nabo Yu avatar Junhu Zhang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.