What I just pushed

SNN is a terminal simulation of a spiking neural network, written in C. You watch it run live. The code is at https://github.com/kleinpanic/SNN.

What you see

Each neuron gets a bar for its membrane potential. A neuron turns green when it fires and red while it is in its refractory period. When the run ends you get a summary of spike counts per neuron and a short explanation. Press q to quit early.

What is in the model

It is C99 with ncurses and libm. The neurons are integrate-and-fire with a leak and a refractory period. On top of that there is STDP, a conduction delay of 1 to 5 ms on each synapse, a neurotransmitter availability term that recovers over time, and random background noise. The synapses are random, with weights from 0 to 0.5.

These are the main constants, straight from SNN.c:

#define NUM_NEURONS 10
#define NUM_SYNAPSES 20
#define SIM_TIME 1000
#define DT 1
#define THRESHOLD 1.0
#define REFRACTORY_PERIOD 5
#define LEAK_FACTOR 0.95

What it is

The main loop steps time forward 1 ms at a time. There is no event queue, and there are only 10 neurons. So it is a time-stepped teaching sim, nothing bigger.

There is no license file yet.

Run it

sudo apt-get install libncurses5-dev libncursesw5-dev
make
./snn

On Fedora use sudo dnf install ncurses-devel. Run make debug if you want a build with -g.

P.S Thanks for reading. Consider subbing to the RSS feed.
Klein Panic