Refractory period not working

Description of problem

I have created a spiking neural network model with an input layer of Poisson neurons and four layers of conductance-based LIF neurons. I am experiencing issues with refractory period: when I run a simulation, some neurons are firing more frequently than the refractory period should allow.

Minimal code to reproduce problem

V_th = -53*mV
V_r = -90*mV
tau_r = 5*ms
E_l = -74*mV           # leak reversal potential
g_l = 100*nS            # leak conductance
E_e = -20*mV           # excitatory synaptic reversal potential
E_i = -100*mV          # inhibitory synaptic reversal potential
C_m = 0.5*nF           # membrane capacitance

LIF_neurons='''
dv/dt = (g_l*(E_l-v) + g_e*(E_e-v) + g_i*(E_i-v))/C_m    : volt (unless refractory) # membrane potential               
dg_e/dt = -g_e/tau_e                                     : siemens  # post-synaptic exc. conductance 
dg_i/dt = -g_i/tau_i                                     : siemens  # post-synaptic inh. conductance 
'''

self.L1 = NeuronGroup(N_LIF_exc + N_LIF_inh, LIF_neurons, threshold='v > V_th', reset='v = V_r', refractory='tau_r', method='euler')

g_e or g_i are incremented upon the arrival of a spike from an excitatory or inhibitory neuron, respectively.

What you have aready tried

  • Defining refractory period in same way as above without passing as a string: refractory=5*ms
  • Defining refractory period as state variable and then setting it like: L1.refractory = 5*ms
  • Defining refractory period like this: refractory=’(t - lastspike) <= 5*ms’
  • Defining refractory period like this: refractory='timestep(t - lastspike, dt) <= timestep(5*ms, dt)
  • Defining refractory period using the voltage threshold this: refractory=‘v >= -53*mV’
  • Specifying ‘(unless refractory)’ after equations for excitatory and inhibitory conductance

Expected output (if relevant)

The maximum frequency a neuron could fire would be limited by refractory period (max every 5ms in this case)

Actual output (if relevant)

Some neurons are firing every integration time-step (0.1ms)

Full traceback of error (if relevant)

This looks like it ought to work and it’s a very straightforward example so I’m a bit confused. I can see two things that might be relevant.

  1. Something to do with the self.L1 = .... You have to be a little bit careful about namespaces when you’re attaching objects to a class. Can you reproduce the same problem when it’s not part of a class?
  2. You said that ge and gi are being incremented when there’s an incoming spike, but that’s correct for the code you’ve written because it’s only v that has (unless refractory) added. Can you confirm that ge and gi are being incremented if you add (unless refractory) after them?
1 Like

Thanks for your reply. I think it was a namespace issue after all - I hadn’t added tau_r to the dictionary of parameters I was passing in as the namespace argument of the run() function when running a simulation - silly mistake!

1 Like