pre2post_sum

Contents

pre2post_sum#

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

The pre-to-post synaptic summation.

This function is equivalent to:

post_val = np.zeros(post_num)
for i, j in zip(pre_ids, post_ids):
  post_val[j] += pre_values[pre_ids[i]]
Parameters:
  • pre_values (float, ArrayType) – The pre-synaptic values.

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

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

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

Returns:

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

Return type:

ArrayType