Ticket #58 (closed defect: invalid)

Opened 17 months ago

Last modified 17 months ago

Voltage threshold crossings not detected under certain circumstances

Reported by: partzsch@… Owned by:
Priority: major Milestone:
Component: Core Version: 1.2.0
Keywords: Cc:

Description

For the LIAF neuron model with current-based synapses, crossings of the membrane voltage threshold are sometimes ignored. In consequence, the membrane voltage can reach values as high as 16 at a threshold of 1.1 before a postsynaptic spike is generated.

I used the following PyNN script to access the simulator (it is very unlikely that the bug is in the PyNN interface, because the threshold value is only forwarded to Brian; furthermore, the threshold crossing is detected sometimes and sometimes is not, suggesting that something is wrong with the internal treshold handling):

import numpy
import sys

simulatorname = 'brian'

exec("import pyNN.%s as pynn" % simulatorname)

tstep = 0.1
tdelaydelta = 0.0
conndelay = 1.0

pynn.setup(timestep=tstep,min_delay=tstep,max_delay=conndelay)

# neuron params
nparams = {
			'tau_refrac': 5.0,
			'tau_m': 100.0,
			'i_offset': 0.0,
			'cm': 10.0e-3,
			'v_init': 0.0,
			'v_thresh': 1.1,
			'tau_syn_E': 1.0,
			'v_rest': 0.0,
			'tau_syn_I': 5.0,
			'v_reset': 0.0
		  }

# values for default spike train
delta_tspike = 3.0
spike_count = 50
simtime = delta_tspike*(spike_count) + 50.0

inspikes = [];
for n in range(spike_count):
	inspikes.append((n+1)*delta_tspike-tdelaydelta)


stim = pynn.create(pynn.SpikeSourceArray, cellparams = {'spike_times':inspikes})
neuron = pynn.create(pynn.IF_curr_exp, cellparams = nparams)

pynn.connect(stim,neuron,weight=7.0e-3,delay=conndelay)

pynn.record(neuron,'spikes_pynn.txt')
pynn.record_v(neuron,'vmem_pynn.txt')

pynn.run(simtime)


# special output with times

srecorder = pynn.simulator.recorder_list[0]
vrecorder = pynn.simulator.recorder_list[1]
sdata = srecorder.get()
vdata = vrecorder.get()

# correct time units to seconds
negcount = 0
for entry in vdata:
	entry[1] = 0.001*entry[1]
	if (entry[1] < 0.0):
		entry[1] = 0.0
		negcount += 1

vdata = vdata[negcount:-1,:]

if (len(sdata.shape) == 1):
	sdata = numpy.array(sdata)

if (sdata.size):
	for ndata in range(sdata.shape[0]):
		sdata[ndata,1] = 0.001*sdata[ndata,1]


print numpy.max(vdata[:,2])

if (vdata.size):
	numpy.savetxt('vmem_brian.txt', vdata, fmt='%d\t%.18e\t%.18e')

pynn.end(compatible_output=False)

Change History

Changed 17 months ago by thesamovar

  • status changed from new to closed
  • resolution set to invalid

This is not a bug in Brian, but something to do with PyNN. In pynn.brian, file simulator.py (line 84 in version 0.6.0), class ThresholdNeuronGroup?, they call brian.NeuronGroup?.init with refractory=100*ms. I don't know why they do this, or what the ThresholdNeuronGroup? object is supposed to do, but this long refractory period is what is causing it not to fire spikes after the threshold is crossed. There was a change in the way Brian handles refractoriness in a relatively recent update of Brian (not sure which one). It looks like the PyNN people have made a hack that worked for an older version of Brian due to a peculiarity of the way we handled refractoriness before that now breaks their code.

Note: See TracTickets for help on using tickets.