3.15. Hybrid networks

Converting a rate-coded population to a spiking population requires connecting a PoissonPopulation (see Specific Populations) with the rate-coded one.

Converting a spiking population with a rate-coded one requires the use of a DecodingProjection, which can connected using any connector method available for Projection.

3.15.1. Class DecodingProjection

class ANNarchy.DecodingProjection(pre, post, target, window=0.0)[source]

Decoding projection to transform spike trains into firing rates.

The pre-synaptic population must be a spiking population, while the post-synaptic one must be rate-coded.

Pre-synaptic spikes are accumulated for each post-synaptic neuron. A sliding window can be used to smoothen the results with the window parameter.

The decoded firing rate is accessible in the post-synaptic neurons with sum(target).

The projection can be connected using any method available in Projection (although all-to-all or many-to-one makes mostly sense). Delays are ignored.

The weight value allows to scale the firing rate: if you want a pre-synaptic firing rate of 100 Hz to correspond to a post-synaptic rate of 1.0, use w = 1./100..


pop1 = PoissonPopulation(1000, rates=100.)
pop2 = Population(1, Neuron(equations="r=sum(exc)"))
proj = DecodingProjection(pop1, pop2, 'exc', window=10.0)


  • pre: pre-synaptic population.
  • post: post-synaptic population.
  • target: type of the connection.
  • window: duration of the time window to collect spikes (default: dt).