brainevent.update_fixed_post_conn_on_binary_pre

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 i and 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 (None disables the corresponding bound).

  • w_max (jax.Array, Quantity, number, or None, optional) – Clip bounds (None disables the corresponding bound).

  • shape (Tuple[int, int]) – Logical (num_pre, num_post).

  • backend (str | None) – Backend override.

Returns:

Updated weights, shape (num_pre, num_conn).

Return type:

jax.Array or Quantity

Raises:

ValueError – If data is homogeneous (size-1) while the connectivity stores more than one synapse.

See also

brainevent.FixedNumPerPre.update_on_post

Post-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))