• Stars
    star
    119
  • Rank 297,930 (Top 6 %)
  • Language Cuda
  • License
    GNU General Publi...
  • Created about 6 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Spiking Neural Networks in C++ with strong GPU acceleration through CUDA

cuSNN

cuSNN is a C++ library that enables GPU-accelerated simulations of large-scale Spiking Neural Networks (SNNs).

This project was created for the work "Unsupervised Learning of a Hierarchical Spiking Neural Network for Optical Flow Estimation: From Events to Global Motion Perception" (Paredes-Vallés, F., Scheper, K.Y., and de Croon, G.C.H.E., 2018).

If you use this library in an academic publication, please cite our work:

@article{paredes2020unsupervised,
  title={Unsupervised Learning of a Hierarchical Spiking Neural Network for Optical Flow Estimation: From Events to Global Motion Perception},
  author={Paredes-Valles, Federico and Scheper, Kirk Yannick Willehm and De Croon, Guido Cornelis Henricus Eugene},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
  year={2020},
  volume={42},
  number={8},
  pages={2051-2064},
  publisher={IEEE}
}

More about cuSNN

cuSNN is a library that consists of the following files:

File Description
cusnn.cu/.cuh CUDA GPU engine
cusnn_kernels.cu/.cuh CUDA device functions for GPU engine

In cuSNN, a SNN is defined using the following host/device classes:

Classes Content
Network Layer objects and architecture parameters.
Network -> Layer Kernel object and layer parameters.
Network -> Layer -> Kernel Neural and synaptic parameters.

The cuSNN library has been tested on Linux systems only.

Layer Types

  • Conv2d: 2D convolution over an input neural map composed of several input channels.
  • Conv2dSep: 2D separable convolution over an input neural map composed of several input channels.
  • Pooling: 2D pooling over an input neural map composed of several input channels.
  • Merge: 1x1 convolution with unitary weights over an input neural map composed of several input channels.
  • Dense: Full connectivity to an input neural map composed of several input channels.

Synapse and Neuron Models

At the moment, only the models proposed in our work are implemented. These are:

  • Leaky Integrate-and-Fire (LIF) neuron model
  • Trace-based adaptive LIF neuron model
  • Static synapse model

Learning Rules

At the moment, only the following learning rules are implemented:

Installation

Requirements:

Get the cuSNN source:

git clone https://github.com/fedepare/cuSNN.git
cd cuSNN

Install cuSNN:

Run the following Python script to install the cuSNN library:

python setup.py <install_dir>   # Python 2.*
python3 setup.py <install_dir>  # Python 3.*

By default, cuSNN installation directory is /usr/local. Hence, administrative privileges may be required. A different installation directory can be specified using the <install_dir> argument, as indicated above.

To uninstall all files, run:

xargs rm < build/install_manifest.txt

Again, administrative privileges may be required depending on your instllation directory.

cuSNN samples

Several samples are available to demonstrate the main features provided by the cuSNN library. These are stored in the submodule cuSNN-samples. To incorporate them to your current directory, run:

git submodule update --init --recursive

P.S.: This process can be a bit slow since a small dataset is included.

Building cuSNN samples

In Linux, the samples are built using makefiles. For this, go to the sample directory you wish and run:

make clean
make

In the makefile of each sample, there are compilation flags to adapt the simulation to your needs. Depending on their value, some of the following libraries may be required:

  • PLOTTER: OpenGL and FreeGLUT for visualization
  • SNAPSHOT: cnpy library for converting C++ arrays to Numpy

In case your installation directory differs from /usr/local, -lcuSNN needs to be removed from the definition of the LIBSUSR* compilation flags, and LIBSCUSTOM needs to be defined as follows:

LIBSCUSTOM = -I<install_dir>/include -L<install_dir>/lib -lcuSNN

Further, if your installation directory differs from /usr/local, you may need to include the installation directory to your LD_LIBRARY_PATH environment variable so the executable can find the library at runtime. You can do this by adding the following line to your ~/.bashrc file:

LD_LIBRARY_PATH="$LD_LIBRARY_PATH:<install_dir>/lib"
export LD_LIBRARY_PATH

or by running the following command in every new terminal window in which a cuSNN sample wants to be run:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<install_dir>/lib

Running cuSNN samples

Once the sample of your choice is built as explained above, simply run the executable as follows:

./build/main

The Team

cuSNN is currently maintained by Fede Paredes-Vallés, Kirk Scheper, and Guido de Croon.

More Repositories

1

event_flow

Self-Supervised Learning of Event-based Optical Flow with Spiking Neural Networks
Python
83
star
2

ssl_e2vid

Python
68
star
3

AvoidBench

AvoidBench
C++
58
star
4

gazebo_models

Collection of Gazebo models and world files.
37
star
5

iridium

Transparent Iridium Communication
Python
30
star
6

sniffy-bug

Sniffy Bug: A fully autonomous swarm of gas-seeking nano quadcopters in cluttered environments
HTML
27
star
7

drone_vision

Very Light-Weight Efficient Onboard Image Processing Library in C
C
25
star
8

SGBA_code_SR_2019

25
star
9

risk-sensitive-rl

Adaptive Risk Tendency Implicit Quantile Network for Drone Navigation under Partial Observability.
Python
24
star
10

idnet

Python
16
star
11

spiking

Collection of templates and examples for implementing spiking neural networks in plain PyTorch and JAX (coming).
Python
15
star
12

taming_event_flow

Taming Contrast Maximization for Learning Sequential Event-based Optical Flow Estimation
Python
14
star
13

AutoGDM

Automatic environment generation and Gas Dispersion Modeling tool
C++
14
star
14

CUAHN-VIO

CUAHN-VIO: Content-and-Uncertainty-Aware Homography Network for Visual-Inertial Odometry
12
star
15

optimal_quad_control_SL

End-to-end optimal quadcopter control through Supervised Learning
Jupyter Notebook
11
star
16

highspeedlogger

High-Speed SD logger
C
9
star
17

cuSNN-samples

Samples which demonstrate features provided by cuSNN
C++
8
star
18

chdkptp

Lua
6
star
19

radar_nav

ROS tools for radar-based navigation (obstacle avoidance)
C++
6
star
20

crazyflie-suite

Flight and data analysis framework for Crazyflies.
Python
6
star
21

IP-STDP-FlowNet

Python
5
star
22

faith

C++
5
star
23

t4_actuators_board

A solution to have speedy Servo and ESC feedback to your Flightcontroller
C++
5
star
24

blimp_snn

Evolved neuromorphic radar-based altitude controller for an autonomous open-source blimp
Python
4
star
25

wind_system

Low-Speed Multi-Fan Wind System
G-code
4
star
26

loihi

Python
4
star
27

neuro_pid

The neuromorphic PID for altitude control of MAVs with Loihi
C++
4
star
28

optimal_quad_control_RL

End-to-end optimal quadcopter control through Reinforcement Learning
Jupyter Notebook
4
star
29

PPRZGroundstation

Java
3
star
30

publications

publications
TeX
3
star
31

paparazzi_log_parsing

MATLAB
3
star
32

opencv_bebop

Makefile
3
star
33

depth_avoider_crazyflie

Supplement materials for Micro Quadcopter Obstacle Avoidance with a Lightweight Monocular Depth Network
Python
3
star
34

network_chargers

Graupner Ultra Duo 16 charger ethernet access
Python
3
star
35

NavDataset

A novel multi-vision sensor dataset for insect-inspired outdoor autonomous navigation
Python
2
star
36

fastPyDroneSim

Python
2
star
37

UnifiedOptitrackClients

Goal: one codebase to stream optitrack to all autopilots used in the MAVLab
C++
2
star
38

bluegiga

Firmware for ble121LR bluetooth module used for airborne datalink over spi
2
star
39

racebian

Pi-Zero Companion Computer for Betaflight
Shell
2
star
40

neuromorphic_attitude_estimation

Neuromorphic computing for attitude estimation onboard quadrotors
Python
1
star
41

crazyflie-firmware

C
1
star
42

tudelft_uavcan

C
1
star
43

latex_style

This repository contains the MAVLab style for papers. Use this style to archive the paper on our own website, or when you are not allowed to use the layout of the journal.
TeX
1
star
44

vutura_utm

C++
1
star
45

indiflightGroundstation

C++
1
star
46

PPRZServices

Paparazzi Android Services
Java
1
star
47

nanoflownet

Code and trained networks of the paper "NanoFlowNet: Real-time Dense Optical Flow on a Nano Quadcopter"
1
star
48

tudelft_vision

TU Delft - Vision
C++
1
star
49

arduino_tof

Adruino Time of Flight software
C++
1
star
50

tx_configs

Transmitters configurations
Lua
1
star
51

gradient_bug

Python
1
star
52

Orangepi_PPZ

This repository allows to interface a SBC such as the OrangePi or the RasperryPi with an autopilot like the Orange Cube through UART.
C
1
star
53

indiflightSupport

Mono-repo for all support tools to fly with indiflight
Python
1
star