All Projects → uzh-rpg → snn_angular_velocity

uzh-rpg / snn_angular_velocity

Licence: GPL-3.0 license
Event-Based Angular Velocity Regression with Spiking Networks

Programming Languages

python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
Cuda
1817 projects

Projects that are alternatives of or similar to snn angular velocity

spikeRNN
No description or website provided.
Stars: ✭ 28 (-69.23%)
Mutual labels:  spiking-neural-networks
brian2cuda
A brian2 extension to simulate spiking neural networks on GPUs
Stars: ✭ 46 (-49.45%)
Mutual labels:  spiking-neural-networks
BrainPy
Brain Dynamics Programming in Python
Stars: ✭ 242 (+165.93%)
Mutual labels:  spiking-neural-networks
spiketorch
Experiments with spiking neural networks (SNNs) in PyTorch. See https://github.com/BINDS-LAB-UMASS/bindsnet for the successor to this project.
Stars: ✭ 83 (-8.79%)
Mutual labels:  spiking-neural-networks
nengo-dl
Deep learning integration for Nengo
Stars: ✭ 76 (-16.48%)
Mutual labels:  spiking-neural-networks
hybrid-snn-conversion
Training spiking networks with hybrid ann-snn conversion and spike-based backpropagation
Stars: ✭ 72 (-20.88%)
Mutual labels:  spiking-neural-networks
snn object recognition
One-Shot Object Appearance Learning using Spiking Neural Networks
Stars: ✭ 23 (-74.73%)
Mutual labels:  spiking-neural-networks
OpenNAS
OpenN@S: Open-source software to NAS automatic VHDL code generation
Stars: ✭ 15 (-83.52%)
Mutual labels:  spiking-neural-networks
spikeflow
Python library for easy creation and running of spiking neural networks in tensorflow.
Stars: ✭ 30 (-67.03%)
Mutual labels:  spiking-neural-networks
norse
Deep learning for spiking neural networks
Stars: ✭ 59 (-35.16%)
Mutual labels:  spiking-neural-networks
WheatNNLeek
Spiking neural network system
Stars: ✭ 26 (-71.43%)
Mutual labels:  spiking-neural-networks
BrainSimII
Neural Simulator for AGI research and development
Stars: ✭ 51 (-43.96%)
Mutual labels:  spiking-neural-networks
DL-NC
spiking-neural-networks
Stars: ✭ 34 (-62.64%)
Mutual labels:  spiking-neural-networks
BrainModels
Brain models implementation with BrainPy
Stars: ✭ 36 (-60.44%)
Mutual labels:  spiking-neural-networks
rA9
JAX-based Spiking Neural Network framework
Stars: ✭ 60 (-34.07%)
Mutual labels:  spiking-neural-networks
LSM
Liquid State Machines in Python and NEST
Stars: ✭ 39 (-57.14%)
Mutual labels:  spiking-neural-networks
snn-encoder-tools
Data encoders
Stars: ✭ 26 (-71.43%)
Mutual labels:  spiking-neural-networks
bindsnet
Simulation of spiking neural networks (SNNs) using PyTorch.
Stars: ✭ 34 (-62.64%)
Mutual labels:  spiking-neural-networks
spore-nest-module
Synaptic Plasticity with Online Reinforcement learning
Stars: ✭ 24 (-73.63%)
Mutual labels:  spiking-neural-networks
Spiking-Restricted-Boltzmann-Machine
RBM implemented with spiking neurons in Python. Contrastive Divergence used to train the network.
Stars: ✭ 23 (-74.73%)
Mutual labels:  spiking-neural-networks

Event-Based Angular Velocity Regression with Spiking Networks

SNN Regression

This is the code for the paper Event-Based Angular Velocity Regression with Spiking Networks by Mathias Gehrig, Sumit Bam Shrestha, Daniel Mouritzen and Davide Scaramuzza.

You can find a pdf of the paper here. If you use any of this code, please cite the following publication:

@Article{Gehrig20icra,
  author        = {Mathias Gehrig and Sumit Bam Shrestha and Daniel Mouritzen and Davide Scaramuzza},
  title         = {Event-Based Angular Velocity Regression with Spiking Networks},
  journal       = {{IEEE} International Conference on Robotics and Automation (ICRA)},
  url           = {http://rpg.ifi.uzh.ch/docs/ICRA20_Gehrig.pdf},
  year          = 2020
}

Setup

Tested with:

  • PyTorch 1.4.0
  • torchvision 0.5.0
  • strictyaml 1.0.6
  • tqdm 4.43.0

using:

  • Ubuntu 18.04.4 LTS
  • gcc 7.4.0
  • CUDA Tookit 10.0
  • Nvidia Turing GPUs

Data and Log Directory

git clone [email protected]:uzh-rpg/snn_angular_velocity.git
cd snn_angular_velocity

Either set up data and logs directory within the cloned repository with:

export data_dir=$(pwd)/data
export log_dir=$(pwd)/logs
mkdir -p $data_dir $log_dir/train $log_dir/test

or set up an external data and logs directory with symbolic links:

export data_dir="YOUR_DATA_PATH"
export log_dir="YOUR_LOG_PATH"

mkdir -p $data_dir $log_dir/train $log_dir/test
ln -s $data_dir data
ln -s $log_dir logs

or pass the data and logging directories with arguments. For more info:

python test.py -h

Installation with Anaconda

Adapt the CUDA toolkit version according to your setup. We also recommend to build PyTorch from source to avoid conflicts while compiling SLAYER. However the following option might work for you as well:

Create conda environment from scratch with precompiled PyTorch

cuda_version=10.0

conda create -y -n snn python=3.7
conda activate snn
conda install -y pytorch torchvision cudatoolkit=$cuda_version -c pytorch
conda install -y strictyaml tqdm -c conda-forge
conda install -y h5py pyyaml -c anaconda

# Setup for SLAYER
cd slayerpytorch
python setup.py install
cd ..

Download Dataset and Model

Download pretrained model.

wget "http://rpg.ifi.uzh.ch/data/snn_angular_velocity/models/pretrained.pt" -O pretrained/cnn5-avgp-fc1.pt

Download and extract test dataset. This requires zstd which you can get with sudo apt install zstd on Ubuntu.

wget "http://rpg.ifi.uzh.ch/data/snn_angular_velocity/dataset/test.tar.zst" -O $data_dir/test.tar.zst
cd $data_dir
zstd -vd test.tar.zst
tar -xvf test.tar
rm test.*

Similarly, you can get the training dataset

wget "http://rpg.ifi.uzh.ch/data/snn_angular_velocity/dataset/train.tar.zst" -O $data_dir/train.tar.zst

validation dataset

wget "http://rpg.ifi.uzh.ch/data/snn_angular_velocity/dataset/val.tar.zst" -O $data_dir/val.tar.zst

and the original panorama images to recreate the dataset from scratch

wget "http://rpg.ifi.uzh.ch/data/snn_angular_velocity/dataset/imgs.tar" -O $data_dir/imgs.tar

Test

To reproduce the numbers in the paper run:

python test.py

Config file

This uses by default the configuration file in test_config.yaml. Modify the test config if you want to change one of the following parameters:

  • Batch size
  • Number of reader threads
  • GPU device number

Writing predictions to disk

If you would like to write the predictions of the network to disk:

python test.py --write

This will generate the following three files in $log_dir/test/*/out/:

  • indices.npy (sample): for each sample the index of the h5 filename that has been used.
  • groundtruth.npy (sample, angle, time): groundtruth angular velocity
  • predictions.npy (sample, angle, time): predicted angular velocity
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].