GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
Weight update models

Currently 4 predefined weight update models are available:

Defining a new weight update model

Like the neuron models discussed in Defining your own neuron type, new weight update models are created by defining a class derived from WeightUpdateModels::Base. For convenience, :

  • perform the same roles as they do in the neuron models discussed in Defining your own neuron type.
  • .
  • : defines the simulation code that is used when a true spike is detected. The update is performed only in timesteps after a neuron in the presynaptic population has fulfilled its threshold detection condition. Typically, spikes lead to update of synaptic variables that then lead to the activation of input into the post-synaptic neuron. Most of the time these inputs add linearly at the post-synaptic neuron. This is assumed in GeNN and the term to be added to the activation of the post-synaptic neuron should be applied using the the $(addToInSyn, weight) function. For example where "inc" is the increment of the synaptic input to a post-synaptic neuron for each pre-synaptic spike. The simulation code also typically contains updates to the internal synapse variables that may have contributed to $(inc). For an example, see WeightUpdateModels::StaticPulse for a simple synapse update model and WeightUpdateModels::PiecewiseSTDP for a more complicated model that uses STDP. To apply input to the post-synaptic neuron with a dendritic (i.e. between the synapse and the postsynaptic neuron) delay you can instead use the $(addToInSynDelay, weight, delay) function. For example where, once again, $(inc) is the magnitude of the input step to apply and delay is the length of the dendritic delay in timesteps. By implementing delay as a weight update model variable, heterogeneous synaptic delays can be implemented. For an example, see WeightUpdateModels::StaticPulseDendriticDelay for a simple synapse update model with heterogeneous dendritic delays.
    Note
    When using dendritic delays, the maximum dendritic delay for a synapse populations must be specified using the SynapseGroup::setMaxDendriticDelayTimesteps() function.
    One can also define synaptic effects that occur in the reverse direction, i.e. terms that are added to a target variable in the persynaptic neuron using the $(addToPre, expression) function. For instance, would add terms $(inc)*$(V_post) to the predefined presynaptic variable $(Isyn) for each outgoing synapse of a presynaptic neuron. One can also set alternative input variables in the presynaptic neuron as the target variable of this reverse input using , see section Additional input variables on how to define additional input variables for a neuron population.
    Note
    $(addToPre, expression) can be used in , , , .
    Unlike for normal forward synaptic actions, reverse synaptic actions with $(addToPre,$(inc)) are not modulated through a post-synaptic model but added directly into the indicated presynaptic target input variable, such as $(Isyn).
  • defines the code which is used in the learnSynapsesPost kernel/function, which performs updates to synapses that are triggered by post-synaptic spikes. This is typically used in STDP-like models e.g. WeightUpdateModels::PiecewiseSTDP.
  • define whether the weight update needs to know the times of the spikes emitted from the pre and postsynaptic populations. These can then be accessed through $(sT_pre) and $(sT_post). For example an STDP rule would be likely to require:
  • define whether the weight update needs to know the times of the previous (i.e. not the ones being processed this timeste) spikes emitted from the pre and postsynaptic populations. These can then be accessed through $(prev_sT_pre) and $(prev_sT_post).

For example, we can define a simple additive STDP rule with nearest-neighbour spike pairing and the following time-dependence:

\begin{align*} \Delta w_{ij} & = \ \begin{cases} A_{+}\exp\left(-\frac{\Delta t}{\tau_{+}}\right) & if\, \Delta t>0\\ A_{-}\exp\left(\frac{\Delta t}{\tau_{-}}\right) & if\, \Delta t\leq0 \end{cases} \end{align*}

in a fully event-driven manner as follows:

Pre and postsynaptic dynamics

The memory required for synapse variables and the computational cost of updating them tends to grow with $O(N^2)$ with the number of neurons. Therefore, if it is possible, implementing synapse variables on a per-neuron rather than per-synapse basis is a good idea. The are used to define any pre or postsynaptic state variables. Then the can be used to define any time-driven updates to these variables and the any spike-driven updates. For example, using pre and postsynaptic variables, our event-driven STDP rule can be extended to use all-to-all spike pairing using pre and postsynaptic trace variables [4] :

Note
These pre and postsynaptic code snippets can only access the corresponding pre and postsynaptic variables as well as those associated with the pre or postsynaptic neuron population. Like other state variables, variables defined here as NAME can be accessed in weight update model code strings using the $(NAME) syntax.

Synapse dynamics

Unlike the event-driven updates previously described, synapse dynamics code is run for each synapse, each timestep i.e. unlike the others it is time-driven. This can be used where synapses have internal variables and dynamics that are described in continuous time, e.g. by ODEs. However using this mechanism is typically computationally very costly because of the large number of synapses in a typical network. By using the $(addToInSyn) and $(addToInSynDelay) functions discussed in the context of SET_SIM_CODE(), the synapse dynamics can also be used to implement continuous synapses for rate-based models. Synapse dynamics code is added to a model using the , for example a continous synapse could be implemented as follows:

Spike-like events

As well as time-driven synapse dynamics and spike event-driven updates, GeNN weight update models also support "spike-like events". These are triggerd by a threshold condition – implemented with the code string specified using the . This typically involves the pre-synaptic variables, e.g. the membrane potential:

Whenever this expression evaluates to true, the event code set using the is executed. For an example, see WeightUpdateModels::StaticGraded. Weight update models can indicate whether they require the times of these spike-like-events using the . These times can then be accessed through the $(seT_pre) and $(prev_seT_pre) variables.


Previous | Top | Next