brainevent.update_fixed_post_conn_on_binary_pre#
- brainevent.update_fixed_post_conn_on_binary_pre = <NameScope(brainevent.update_fixed_post_conn_on_binary_pre)>#
Pre-spike STDP update for a
FixedNumPerPre(favorable, row-driven).For each firing pre neuron
iand every stored synapse(i, j):W[i, j] <- clip(W[i, j] + post_trace[j], w_min, w_max).- Parameters:
data (jax.Array or Quantity) – Heterogeneous ELL weights, shape
(num_pre, num_conn).indices (jax.Array) – Post-synaptic ids, shape
(num_pre, num_conn).pre_spike (jax.Array) – Pre-synaptic spikes (bool or float), shape
(num_pre,).post_trace (jax.Array or Quantity) – Post-synaptic trace, shape
(num_post,).w_min (jax.Array, Quantity, number, or None, optional) – Clip bounds (
Nonedisables the corresponding bound).w_max (jax.Array, Quantity, number, or None, optional) – Clip bounds (
Nonedisables the corresponding bound).
- Returns:
Updated weights, shape
(num_pre, num_conn).- Return type:
jax.Array or Quantity
- Raises:
ValueError – If
datais homogeneous (size-1) while the connectivity stores more than one synapse.
See also
brainevent.FixedNumPerPre.update_on_postPost-spike (unfavorable) counterpart, served by the perm-fused CSR plasticity primitive.
Examples
>>> import jax.numpy as jnp >>> from brainevent._fcn.plasticity_binary import update_fixed_post_conn_on_binary_pre >>> data = jnp.array([[0.5, 0.3], [0.8, 0.2]], dtype=jnp.float32) >>> indices = jnp.array([[0, 1], [1, 2]], dtype=jnp.int32) >>> pre_spike = jnp.array([True, False]) >>> post_trace = jnp.array([0.1, 0.2, 0.05], dtype=jnp.float32) >>> update_fixed_post_conn_on_binary_pre( ... data, indices, pre_spike, post_trace, shape=(2, 3))