pre2post_mean

Contents

pre2post_mean#

class brainpy.math.pre2post_mean(pre_values, post_num, post_ids, pre_ids=None)[source]#

The pre-to-post synaptic mean computation.

Parameters:
  • pre_values (float, ArrayType) – The pre-synaptic values.

  • pre_ids (ArrayType) – The connected pre-synaptic neuron ids.

  • post_ids (ArrayType) – The connected post-synaptic neuron ids.

  • post_num (int) – Output dimension. The number of post-synaptic neurons.

Returns:

post_val – The value with the size of post-synaptic neurons.

Return type:

ArrayType

Notes

When pre_values is a scalar, every connection carries the same constant value, so the per-post mean is simply that constant. In this case the function broadcasts the constant to every targeted post-synaptic neuron (untargeted neurons stay 0). Duplicate post_ids therefore do not require any averaging – the mean of identical values equals the value itself.