brainpy.math.operators.pre2syn#

brainpy.math.operators.pre2syn(pre_values, pre_ids)[source]#

The pre-to-syn computation.

Change the pre-synaptic data to the data with the dimension of synapses.

This function is equivalent to:

syn_val = np.zeros(len(pre_ids))
for syn_i, pre_i in enumerate(pre_ids):
  syn_val[i] = pre_values[pre_i]
Parameters
  • pre_values (float, jax.numpy.ndarray, JaxArray, Variable) – The pre-synaptic value.

  • pre_ids (jax.numpy.ndarray, JaxArray) – The pre-synaptic neuron index.

Returns

syn_val – The synaptic value.

Return type

jax.numpy.ndarray, JaxArray