{"id":14992133,"url":"https://github.com/michaelmelanson/spiking-neural-net","last_synced_at":"2025-09-25T14:30:50.989Z","repository":{"id":28617904,"uuid":"113696210","full_name":"michaelmelanson/spiking-neural-net","owner":"michaelmelanson","description":"A spiking neural network simulation library","archived":false,"fork":false,"pushed_at":"2023-03-04T03:56:57.000Z","size":4534,"stargazers_count":23,"open_issues_count":9,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T05:18:23.088Z","etag":null,"topics":["neural-network","neural-networks","neurons","rust","rust-library","science"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelmelanson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-09T19:39:55.000Z","updated_at":"2024-10-25T09:59:22.000Z","dependencies_parsed_at":"2023-01-14T09:11:06.123Z","dependency_job_id":null,"html_url":"https://github.com/michaelmelanson/spiking-neural-net","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelmelanson%2Fspiking-neural-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelmelanson%2Fspiking-neural-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelmelanson%2Fspiking-neural-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelmelanson%2Fspiking-neural-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelmelanson","download_url":"https://codeload.github.com/michaelmelanson/spiking-neural-net/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234200170,"owners_count":18795139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neural-network","neural-networks","neurons","rust","rust-library","science"],"created_at":"2024-09-24T15:00:45.783Z","updated_at":"2025-09-25T14:30:50.461Z","avatar_url":"https://github.com/michaelmelanson.png","language":"Rust","funding_links":[],"categories":["Machine Learning","Frameworks"],"sub_categories":[],"readme":"# spiking-neural-net [![Build Status](https://travis-ci.org/michaelmelanson/spiking-neural-net.svg?branch=master)](https://travis-ci.org/michaelmelanson/spiking-neural-net)\nA spiking neural network simulation library.\n\n## Usage\n\nYou will need a Rust development environment, which you can install by visiting https://rustup.rs/ and following the instructions.\n\nOnce you have Rust and Cargo installed, you can run a simulation with:\n\n    make\n  \n\nYou should see output like this:\n\n![Sample output](https://github.com/michaelmelanson/spiking-neural-net/blob/master/images/sample%20output.png)\n\nThis will produce plot images called `neuron-trace.png` and `spikes.png` like the ones below.\n\nNote that you can also build the debug version by omitting the `--release` flag, but it will run slowly. This is good if you want to use a debugger, but if you want to simulate any reasonably large networks in real-time you will need to use release mode.\n\n## Sample output\n\nIt should create output images like this:\n\nFilename      | Image\n--------------|-----------\n`neuron-trace.png` | ![spikes.png](https://github.com/michaelmelanson/spiking-neural-net/blob/master/images/neuron-trace.png) This shows the activity of a single neuron. Each of the vertical lines is an action potential, shown as a white dot on the plots below. There's a noise floor representing random thalamic input.\n`spikes.png` | ![spikes.png](https://github.com/michaelmelanson/spiking-neural-net/blob/master/images/spikes.png) You'll need to download this image and zoom in to see the activity.\n`spikes.png` (cropped) | ![spikes.png](https://github.com/michaelmelanson/spiking-neural-net/blob/master/images/spikes%20(cropped).png) This represents about 1s of time across 1100 neurons.\n\nThe `spikes.png` image shows some fascinating results: \n* In the cropped photo you can see vertical lines of dots. This shows that all the neurons in the network have synchronized and are pulsing together at about 12Hz. This is a similar rate to Alpha waves in mammalian brains.\n* Also in the cropped photo can also see horizontal lines. This is the motor layer of each column; this layer currently is weakly connected and doesn't synchronize with the rest of the neurons.\n* In the full `spikes.png` image there are three distinct phases:\n  * **0s-4s:** The network quickly settles into a 5Hz rhythm, similar to Theta waves. I believe this is when the columns are organizing themselves.\n  * **4s-10s:** The network becomes disorganized. I believe this is when the columns are learning to wire together and are trying to sort out their connections.\n  * **10s+:** The network becomes synchronized at a much faster 12Hz rhythm.\n  \n## About the simulation\n\nThis library simulates networks of biologically-inspired neurons. Spiking neural models are implemented as ordinary differential equations integrated using Euler integration at 1 millisecond resolution.\n\nThe simuation is written in the Rust programming language and uses [Specs](https://github.com/slide-rs/specs), an Entity-Component-System framework with excellent parallelization and performance. This allows it to simulate simulate about 1800 neurons and 100k synapses, including an online learning algorithm, in real-time on a typical laptop. \n\n## Features\n\n### Neural models\n\n- [x] Izhikevich neurons\n  * Model: https://www.izhikevich.org/publications/spikes.htm\n  * Code: https://github.com/michaelmelanson/spiking-neural-net/blob/master/src/simulation/models/izhikevich.rs\n- [x] Hindmarsh-Rose neurons\n  * Model: https://en.wikipedia.org/wiki/Hindmarsh%E2%80%93Rose_model\n  * Code: https://github.com/michaelmelanson/spiking-neural-net/blob/master/src/simulation/models/hindmarsh_rose.rs\n\n### Learning models\n\n- [x] Spike-timing dependent plasticity\n  * Code: https://github.com/michaelmelanson/spiking-neural-net/blob/master/src/simulation/learning/stdp.rs\n\n### Network organization\n\n- [x] Columnar organization\n  * Networks are organized into 100-neuron columns composed of five layers (motor, sensory, afferent, efferent, internal)\n  * Code: https://github.com/michaelmelanson/spiking-neural-net/blob/master/src/simulation/mod.rs#L70-L160\n\n## TODO\n- [ ] Multiple morphologies. Currently all neurons are Izhikevich 'regular spiking' neurons.\n- [ ] Configuration. Currently you need to change the source code to change the network design or neural model parameters.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelmelanson%2Fspiking-neural-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelmelanson%2Fspiking-neural-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelmelanson%2Fspiking-neural-net/lists"}