Git Product home page Git Product logo

st-rsbp's Introduction

Spike-Train level Recurrent Spiking Neural Networks Backpropagation (ST-RSBP) for SNNs

This repo is the CUDA implementation of SNNs trained the Spike-Train level RSNNs Backpropagation, modified based on HM2-BP for spiking neuron networks.

The paper Spike-Train Level Backpropagation for Training Deep Recurrent Spiking Neural Networks is accepted by the Thirty-third Conference on Neural Information Processing Systems, 2019.

Contact [email protected] if you have any questions or concerns.

Dependencies and Libraries

  • OpenCV (3.4 or higher)
  • CUDA (8.0 or higher)
  • OpenMP

You can compile the code on windows or linux.

SDK include path(-I)
  • linux: /usr/local/cuda/samples/common/inc/ (For include file "helper_cuda"); /usr/local/include/opencv/ (Depend on situation)
  • windows: X:/Program Files (x86) /NVIDIA Corporation/CUDA Samples/v6.5/common/inc (For include file "helper_cuda"); X:/Program Files/opencv/vs2010/install/include (Depend on situation)
Library search path(-L)
  • linux: /usr/local/lib/
  • windows: X:/Program Files/opencv/vs2010/install/x86/cv10/lib (Depend on situation)
libraries(-l)
  • opencv_core
  • opencv_highgui
  • opencv_imgproc
  • opencv_imgcodecs (need for opencv3.0)
  • openmp
  • cublas
  • curand
  • cudadevrt
  • cudacusparse
  • cudacurand
  • cudacusolver

Installation

The repo requires CUDA 8.0+ to run.

Please install the opencv and cuda before hand.

Install CMake and OpenCV

$ sudo apt-get install cmake libopencv-dev 

Checkout and compile the code:

$ git clone https://github.com/jinyyy666/mm-bp-snn.git
$ cd mm-bp-snn
$ mkdir build
$ # change the libraries, dependencies and capability of GPU in CMakeLists.txt
$ # if the cmake version is less than 3, set the libraries of CUDA manually
$ cd build
$ cmake ..
$ # if gcc version > 6, using "cmake -DCMAKE_C_COMPILER=gcc-5 -DCMAKE_CXX_COMPILER=g++-5 .."
$ make -j
GPU compute compatibility
  • capability 6.0 for Titan XP, which is used for the authors.
  • Check the compatibility and change the CMAKE file before compile.

Get Dataset

MNIST:

$ cd mnist/
$ ./get_mnist.sh

N-MNIST: Get the N-MNIST dataset by N-MNIST. Then unzip the ''Test.zip'' and ''Train.zip''. Run the matlab code: NMNIST_Converter.m

N-Tidigits: N-Tidigits, read the dataset using N-Tidigits_Converter.py.

Fashion-MNIST: Fashion-MNIST

TI46: Download from TI46 and preprocess it using Lyon ear model using TI46_Lyon_ear.m

Run the code

Before running, use eij_function.m to generate eij file and put the file in Effect_Ratio_file.

By default, put the data in the previous directory "../" Then run

$ ./build/CUDA-RSNN

and follow the instruction.

For Window user

Do the following to set up compilation environment.

  • Install Visual Stidio and OpenCV.
  • When you create a new project using VS, You can find NVIDIA-CUDA project template, create a cuda-project.
  • View-> Property Pages-> Configuration Properties-> CUDA C/C++ -> Device-> Code Generation-> compute_60,sm_60
  • View-> Property Pages-> Configuration Properties-> CUDA C/C++ -> Common-> Generate Relocatable Device Code-> Yes(-rdc=true)
  • View-> Property Pages-> Configuration Properties-> Linker-> Input-> Additional Dependencies-> libraries(-l)
  • View-> Property Pages-> Configuration Properties-> VC++ Directories-> General-> Library search path(-L)
  • View-> Property Pages-> Configuration Properties-> VC++ Directories-> General-> Include Directories(-I)

Notes

  • The SNNs are implemented in terms of layers. User can config the SNNs by using configuration files in Config/
  • The program will save the best test result and save the network weight in the file "Result/checkPoint.txt", If the program exit accidentally, you can continue the program form this checkpoint.
  • The logs for the reported performance and the settings can be found in Result folder.
  • Only batch size = 1 is used in the experiments. Other value of batch size may cause problem.

st-rsbp's People

Contributors

stonezwr avatar jverecken avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

James Cloos avatar paper2code - bot 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.