Skip to content

Learning with spiking neural networks using STDP synapses. Python, PyNN, NEST-simulator, numpy

License

Notifications You must be signed in to change notification settings

kastger/spiking-neural-network

Repository files navigation

Spiking neural network (SNN)

Author:

Geraldas Kastauna
http://www.geraldaskastauna.com

Project supervisor:

Professor Dr. Chris Huyck
https://www.cwa.mdx.ac.uk/chris/chrisroot.html

University:

Middlesex University
The Burroughs, Hendon
London, NW4 4BT
United Kingdom

Disseration theme:

Learning with spiking neural networks

A spiking neural network that uses spike-timing-dependent plasticity (STDP) synapses for training on half of UCI iris data set and then runs tests on the other half of the data.

Requirements (what I used during implementation)

About the program:

snn-stdp.py is the main program that generates training and testing spikes to results folder. More info about the program is inside the file commented at the top.
get-networks-accuracy.py is used to get the accuracy of the network. More info is commented inside the file.
read-pkl-spikes.py is used to check neuron number and its spikes from pkl file that was generated by snn-stdp.py during training and testing phases
iris.data is original iris dataset from UCI (link in the requirements section), but the classes are represented by numbers 0 to 2.

About the SNN:

This spiking neural network is trained on UCI iris dataset that contains total of 150 irises, 50 for each class (iris-setosa, iris-versicolour, iris-virginica). Iris data is split into half (75 for training, 75 for testing).
This SNN uses only two layers of neurons:\

  • Presynaptic layer which contains 104 neurons (26 neurons for each iris data feature(4)).
  • Postsynaptic layer which contains 3 neurons (each neuron represents one of three iris class).

Accuracy and speed:

Accuracy
Best accuracy I managed to get:

  • Training on iris-train.txt data and testing on iris-test.txt:
    Correct system answers: 72 / 75
    Accuracy percentage: 96.00 %
  • Training on iris-test.txt data and testing on iris-train.txt:
    Correct system answers: 62 / 75
    Accuracy percentage: 82.67 %
    AVERAGE ACCURACY: 89.335%

Speed
Tested speed using Linux terminal command - time python snn-stdp.py
real 0m 15.744s
user 0m 15.170s
sys 0m 0.568s

How to use:

  1. Check if there are iris-train.txt and iris-test.txt files.
  2. Make sure everything from the requirements section is installed and up-to-date.
  3. Run snn-stdp.py. Training and testing results are saved in results folder.
  4. If you wanna check the spikes that were generated during training or testing phases, edit the read-pkl-spikes.py file (info on what to edit is commented inside the file) and then run the code and check the console for neuron number and spike time sequence.
  5. To get the accuracy on test file (iris-test.txt) run get-networks-accuracy.py. The amount of correct answers will be printed to the console along with accuracy percentage.

Further studies:

My thesis supervisor Professor Dr. Chris Huyck offered me to team up with him and study learning with spiking neural networks deeper.
I will be working on this during my freetime.

Contact info:

University email: GK468@live.mdx.ac.uk
Personal: geraldaskastauna@gmail.com

About

Learning with spiking neural networks using STDP synapses. Python, PyNN, NEST-simulator, numpy

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages