nest / nestml

A domain specific language for neuron and synapse models in spiking neural network simulation
GNU General Public License v2.0
46 stars 45 forks source link

STDP window: Weight updates only when preSpikes are detected #909

Open Dariofk opened 1 year ago

Dariofk commented 1 year ago

Using the example from NESTLM STDP windows tutorial, I run a simple network (1x1) with my own spike generators such:

sim_time = 50.
pre_sg = nest.Create("spike_generator",
                     params={"spike_times": [2.]})
post_sg = nest.Create("spike_generator",
                      params={"spike_times": [5.],
                              'allow_offgrid_times': True})

I expected some kind of potentiation based on the timing between post-pre spikes and the delay used (delay=1) but I do not see any. However, from the tutorial, I can see that by adding a pre-synaptic spike after the post-synaptic one (really far away in time so it doesnt depress the weight) the weight is potentiated by the post-pre relation. This also appears in the tutorial, where the pre-synaptic spike generator an extra spike is used at "sim_time-10.":

pre_sg = nest.Create("spike_generator",
                     params={"spike_times": [pre_spike_time, sim_time - 10.]})

Maybe I'm missing something but, is there any particular reason why this happens? Although this approach works, its hard to plot the variation of weight with respect of time since the weights are updated when this second pre-synaptic spike is detected and not when the post-one is detected.

Thanks and sorry if this is something its already been discussed but I couldnt find it. Best regards!