In Nengo, the behaviour of the neurons are dependent on the current input to the neuron. If you want to “reproduce” spikes, I think your best bet will be to use a
nengo.Node to output spikes, instead of trying to force the neurons in an ensemble to generate spikes.
To get a node to produce spikes, you just need to define a node function that produces a
1/dt value whenever you want a spike to be produced.
Here is some code that would produce spikes in a node:
def spike_func(t, spikes=spikes, dt=dt):
# Compute index for spikes array
ind = int(t / dt) % spikes.shape
# Note that spikes have an amplitude of 1/dt
return spikes[:, ind] * (1 / dt)
with nengo.Network() as model:
# Use a node to output spikes
spike_node = nengo.Node(spike_func)
And here is a full test script demonstrating the Nengo node spike generation function:
test_node_spike.py (1.5 KB)