Spiking Neurons without Current/Voltage Inputs

Hello folks!

I was wondering if there is a way to generate spikes without using current as input.
In this scenario, I would like to give only the time of spiking to each neuron in an ensemble, and it should spike at that time.
I would not work with the spiking rate or input currents and just give the spike timings as an array, and the neuron should produce spikes at that time instants. Is it possible to implement this with nengo?

Hi @RohanAj,

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[1]

    # 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)

Hi @xchoo

Thanks for the code,

Can we not do this using ensembles instead of nodes to simulate real spiking neurons?

I actually wish to learn the connections between two layers of neurons using BCM, and I want the neurons to spike at given times

Ah! I see. If you look at this forum post, in my example.py file, there is example of how to connect the output of a nengo.Node to drive an ensemble to spike at a certain time. However, this approach still is essentially providing an input current to the neurons to drive them to spike. There is currently no way to do otherwise (i.e., making a neuron spike without changing the input current to the neuron) in Nengo.