Uploaded by Kunal Gupta

Tutorial1

advertisement
Tutorial 1
6CCE3CHD/7CCEMCHD
Bipin Rajendran
Problem 1: Leaky Integrate and Fire Model
The dynamics of the membrane potential V (t), in the LIF neuron model is given by the equation
C
dV (t)
= −gL (V (t) − EL ) + Iapp (t)
dt
(1)
C is the membrane capacitance, gL is the leak conductance and EL is the leak reversal potential.
Iapp is the externally applied current and is assumed to be positive for current flowing into the cell.
When V ≥ VT , a spike is issued and V is reset to EL (We will write this as V (t) ←− EL ).
(Assume that C= 300 pF, gL = 30 nS, VT = 20 mV and EL = −70 mV).
(a) Assume that a constant current I0 is applied to the neuron. Write an expression for the
steady state value of the membrane potential. Hence, determine the minimum value of the steady
state current, Ic necessary to initiate a spike.
(b) Write a code to solve the dynamics of an LIF neuron based on the noisy input generator
provided to you.
(c) In order to simulate the behavior of a set of N neurons, it is useful to define a N × 1 column vector to the store the membrane potentials of the N neurons. Write a program to solve the
equivalent difference equation numerically for a set of N neurons driven by external current input.
(You should not use a FOR loop to calculate the potential of the N neurons, rather, the potential
of all the neurons should be calculated in one step.)
Assume that the input to the program is a N × M column vector, representing the input current
for the N neurons for M time-intervals where M = T /∆t. The output of your program should
be a N × M matrix storing the values of the membrane potential for the N neurons, for the M
time-intervals.
(d) We would like to now use this framework to study the dynamics of LIF neurons. Assume
that you have a population of 10 identical neurons, with each neuron receiving a constant current.
Let the magnitude of the input current for the k th neuron be given by the expression
Iapp,k = (1 + kα)Ic
(2)
where α = 0.1. (In this example, the current does not vary with time, so, all the values across any
row of the input current matrix is a constant). Plot the membrane potential for neurons 2, 4, 6 and
8 from t = 0 to 500 ms. (Assume ∆t = 0.1 ms and at t = 0, the neuron is in steady-state with
Iapp (t) = 0).
(e) Plot the average time interval between spikes from (c) as a function of Iapp,k .
Problem 2: Converting a ANN to a SNN
Let us consider a simple two-layered network, and see how the network behaviour changes if the
neurons obey simple multiply-accumulate (MAC) model vs integrate-and-spike model (SNN).
Assume there are N1 = 9 neurons in the first layer and N2 = 9 neurons in the second layer. In
this network, the jth output neuron receives input from the input neurons 1, 2, . . . j, and all the
synapses have the same strength w0 = 0.2. Hence, neuron 1 at the output is connected only to
neuron 1 in the input, neuron 2 at the output is connected to neurons 1 and 2 at the input, and so on.
(a) We would first like to study the behaviour of the ANN, for a randomly generated input
vector. The output of neuron j in the second layer is given by the equation
rj =
N1
X
wjk xk
(3)
k=1
yj = max(0, rj )
(4)
where xk corresponds to the output of the neuron k in the first layer and wjk is the synapse between
neuron k in the first layer and neuron j in the second layer. In the literature, this is what is called
a ReLU neuron, standing for Rectified Linear Unit.
Calculate the output of a two-layer fully connected ANN with ReLU neurons, where the input
of the kth neuron is xann,k = 0.1 × k for k = 1, 2, . . . N1 . We will assume that there is no bias in
this network.
(b) Now, we will convert the above ANN to SNN. We are going to assume that a real numbered
signal r in a ANN, corresponds to the average spike rate λ of an SNN. At the input, we will use a
Poisson process to generate the spikes.
The pseudo-code to generate a Poisson spike stream for a process with arrival rate λ per ms for
an interval [0, T ] ms with step size dt ms is as follows. Since this process will have on average λT
spikes,
Set N=10λT .
Generate N uniformly distributed random numbers in the interval [0,1]. Call this vector p.
Create a new vector ∆S = −log(1 − p)/λ.
∆S corresponds to the time between the spikes that are Poisson distributed. So, place the first
spike at time ∆S(1), second spike at ∆S(1) + ∆S(2), third spike at ∆S(1) + ∆S(2) + ∆S(3)
and so on.
Since our process has time intervals in step of dt, make sure that the above times are rounded
to nearest integral multiples of dt.
Verify that the average number of spikes generated by your code is approximately equal to the
real numbered inputs.
(c) Now, propagate the spikes from the first layer to the second layer, based on the LIF model
from problem 1, but assuming that C = gL = VT = 1 and EL = 0. You can also assume that
dt = 0.1 and T = 1000. The spike condition is as before: when V ≥ VT , a spike is issued and V is
reset to EL .
The current coming into the second layer neurons is given as
Iapp (t) = Ic
N1
X
wjk xk (t).
(5)
k=1
i.e., each input spike triggers current flow into the output neuron based on the synaptic strength.
Determine the average spike rate of the neurons in the output layer. Assume Ic = 16(VT − EL ) ∗ gL .
Does it match the real-valued output you obtained for the ANN?
(d) Now, we will repeat (c) above, but with a slightly modified reset condition, which we will
call partial reset. When V ≥ VT , a spike is issued, but V is NOT reset to EL , but we subtract VT
from V . i.e., V (t) ←− V (t) − VT . With this partial reset, determine the average spike rate of the
neurons in the output layer.
(e) Which reset mechanism is better?
Download