My question is about spiking neural networks. Input of a typical spiking neuron is usually some floating point value, representing its inflow current, typically expressed in mA or similar units, like in a following simple example:
static const float
dt = 1.0/1000, // sampling period
gL = 0.999, // leak conductance
vT = 30.0; // spiking voltage threshold
float mV = 0; // membrane voltage
// Leaky integrate-and-fire neuron model step
bool step_lif_neuron(float I) { // given input current "I", returns "true" if neuron had spiked
mV += (I - mV*gL)*dt;
if( mV > vT ) { // reset? heaviside function is non-differentiable and discontinuous
mV = 0;
return true;
}
return false;
}
That is fine, if its purpose is to determine relation of input image to some class, or to turn motor or lamp on or off.. But here comes principal problem: a model does not describe neuron interconnection. We cannot connect a neuron to next neuron, as it usually happens inside brain.
How does one convert a bool isSpiked
value of preceeding neuron to float I
input value of next neuron?
This isn't a typical SO question, but here's the answer.
Of course your model doesn't answer your question as it is a neuron model. For connections (synapses in the brain, or elsewhere), you need a model for synapses. In biology, a presynaptic spike (i.e. an "input spike" to a synapse) causes a time-dependent change of the postsynaptic membrane conductance. The shape of this conductance change in biological approximately has a so-called double exponential shape:
where the presynaptic spike occured at time 0.
This conductance change leads to a (time-dependent) current into the postsynaptic neuron (i.e. the neuron receiving the input). For simplicity, many models model the input current directly. The common shapes are
Here's a comparison scaled for same height at max:
and scaled for same overall current (so integral over the time course):
So how does a spike lead to an input current in another neuron in spiking NN models?
Assuming you model currents directly, you need to make a choice of the time course of the current which you want to use in your model. Then, every time a neuron spikes, you inject a current of the shape you chose into the connected neuron.
As an example, using exponential currents: the postsynaptic neuron has a variable I_syn
which gives the synaptic input, each time a presynaptic neuron spikes, it is incremented by the weight of the connection, in all other time steps it decays exponentially with time constant of the synapse (the decay of the exponential).
Pseudocode:
// processing at time step t
I_syn *= exp(-delta_t / tau_synapse) // delta_t is your simulation time step
foreach presynaptic_spike of neuron j:
I_syn += weight_of_connection(j)
The topic isn't answered with a plot or two, or with a single equation. I just wanted to point out the main concepts. You can find more details the Compuational Neuroscience textbook of your choice, e.g. in Gerstner's Neuronal Dynamics (which is available via website).