Giter VIP home page Giter VIP logo

spiking-neural-network's Introduction

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: [email protected]
Personal: [email protected]

spiking-neural-network's People

Contributors

geraldaskastauna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.