Skip to content

Conversation

clinssen
Copy link
Contributor

@clinssen clinssen commented Oct 30, 2024

Fixes #946.
Fixes #944.

Adds attributes to input spike events (see documentation updates inside this PR for more details).

The spike event handle() method now needs to store each received spike in a separate buffer entry, otherwise excitatory and inhibitory spikes (which are distinguished by sign of the weight); if they are not in a separate buffer, an inhibitory spike with weight -4 and excitatory spike of weight 1 would end up as an inhibitory spike of -3). A consequence of this is more buffering is needed, which could result in a performance hit. A code generator option should be introduced, that gives a list of spiking input port names, such that for each port, it allows the regular RingBuffers to be used.

  • The processing of spikes in the FIR filter is now delayed by one resolution timestep. The impact and/or mitigations of this should still be discussed.
  • A new code generator option should be added that allows two separate exc/inh input ports to be merged into one just like was the case originally for NEST Simulator, replicating the existing behaviour for a single rport-model that routes spikes depending on the sign of the weight.
  • A new syntax should provide a difference between grabbing the instantaneous event attribute (for instance, a weight in pA), and adding series of delta pulses to an ODE (where units are multiplied by 1/s to achieve, for instance, pA/s). The proposed syntax for this is to use the attribute as an explicit function of time in the ODEs by appending the (t) suffix, for instance: x' = -x / tau + spikes_in_port.weight(t) (in the equations block) versus x += spikes_in_port.weight (in the onReceive block). Or we require the attributes to be convolved with a delta kernel in the onReceive blocks:
    onReceive(spike_in_port): I_syn += convolve(delta(t), spike_in_port.weight)

Benchmarking shows that performance degradation for the most general case (without linear_time_invariant_spiking_input_ports enabled) is only on the order of 12.5%. With linear_time_invariant_spiking_input_ports enabled, performance is indistinguishable from what it was before this PR.

Notes for reviewers

See especially the following sections in the documentation to review:
From

https://nestml-sandbox.readthedocs.io/en/latest/nestml_language/nestml_language_concepts.html#spiking-input-ports

until (not including) the section "Guards".

@clinssen clinssen marked this pull request as draft October 30, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding attributes to spike events Remove "inhibitory" and "excitatory" spiking input port specifiers

1 participant