PoissonGroup cannot be deactivated properly

Description of problem

I created a PoissonGroup consisting of 100 neurons and the firing rate of each neuron is 300Hz. This PoissonGroup was deactivated at the beginning, and then activated at 1000ms and deactivated at 2000ms again. However, after 2000ms, the PoissonGroup was not completely turned off, some of these neurons fired with an extremely high firing rate (9999 Hz).

Brian2 version: 2.4.2

Minimal code to reproduce problem

group_input_test = PoissonGroup(100,300*Hz)

spk_sti_test = SpikeMonitor(group_input_test, record = True)

net_test = Network(group_input_test, spk_sti_test)

group_input_test.active = False
net_test.run(1000 * ms)
group_input_test.active = True
net_test.run(1000 * ms)
group_input_test.active = False
net_test.run(1000 * ms)

plt.figure()
plt.plot(spk_sti_test.t/ms, spk_sti_test.i,'|')
plt.xlim([0,3000])
plt.xlabel('ms')
plt.ylabel('neuron',fontsize=12)

What you have aready tried

Deactivate the PoissonGroup by setting its attribute “rates” to 0*Hz won’t cause this problem

group_input_test.rates = 0*Hz

Many thanks for this report, this clearly looks like a bug! It seems as if the Poisson neurons that spiked in the very last time step of the “active period” continue to spike at every time step in the “quiet period”. I’ll open an issue on github and will investigate next week.

For reference: PoissonGroup continues to fire with active=False · Issue #1319 · brian-team/brian2 · GitHub

Thanks for solving this problem :slight_smile: