I’m starting to study and use the Nengo simulator and I have a question about the spiking activity of neurons. Can I know when a neuron (presynaptic or postsynaptic) spikes?
I’ve tried to understand the spikes2events method of the utils/neurons.py library, but I cannot understand which parameters I have to give or if there is another method in order to solve my problem.
If it’s possible to know the temporal activity for each neuron, is possible to use it in order to implement a new model of STDP?
P.S.: Sorry if there is another topic with this issue, I have not found it.
Thank you in advance,
I cannot understand which parameters I have to give or if there is another method in order to solve my problem.
Yeah, that could be documented a bit better. Here’s an example:
import nengo
from nengo.utils.neurons import spikes2events
import numpy as np
with nengo.Network() as model:
sin_input = nengo.Node(np.sin)
sin_ens = nengo.Ensemble(100, 1)
nengo.Connection(sin_input, sin_ens)
spikes_probe = nengo.Probe(sin_ens.neurons, synapse=None)
with nengo.Simulator(model) as sim:
sim.run(5.0)
spikes = sim.data[spikes_probe]
spike_times = spikes2events(sim.trange(), spikes)
# print the first 10 spikes of the
print(spike_times[0][:10])
Thank you @Seanny123!
To not open another topic, I reply here in order to receive some help, if it is possible. Of course, you can close this topic or move to a new one.
I’ve to implement this kind of learning rule (Arena et al., 2009)
where:
Δt = tpre - tpost, depends on the presynaptic and postsynaptic activities.
ε(t) is the synaptic response and,
Ij is the synaptic current of the j-th postsynaptic neuron due to all the presynaptic neurons with whom the postsynaptic neuron is linked to.
I’m looking your repository and it has been very helpful! In any case, I have to manage the presynaptic and postsynaptic times in order to update the weights, according to (1). How can I do that? Are there some attributes that I can use?
If it can be useful, this is the class I’ve implemented but I have some problems to implement properly the function of the class.
class STDP(object):
def __init__(self, tau= 0.005, tau_plus=0.020, tau_minus=0.010, learning_rate=1e-6,
in_neurons=1, out_neurons=1, A_plus=0.2, A_minus=-0.2,
sample_every=0.1, start_weights=weights):
self.up_weights = start_weights.copy()
# Parameters of the synapse
self.A_plus = A_plus
self.A_minus = A_minus
self.tau_plus = tau_plus
self.tau_minus = tau_minus
self.tau = tau
self.in_nrns = in_neurons
# Impulse response of the synapse
self.epsilon = np.exp(1)*nengo.Lowpass(tau).make_step(in_neurons, in_neurons, dt, None)
self.weight_history = []
I’m really sick right now, so I won’t be able to give you a detailed answer, but I don’t think you actually need to manage the spike times, because of how synaptic filtering works in the NEF. @tbekolay will be able to tell you more about this if he has time.
In this example, what does the probe measure, is it presynaptic, postsynaptic, an aggregate or something else?
if it is only post- or presynaptic is it possible to probe the other one as well?