bernoulli_synapse

bernoulli_synapse#

class brainpy.state.bernoulli_synapse(*args, **kwargs)#

Static synapse with stochastic (Bernoulli) transmission (NEST bernoulli_synapse).

Each presynaptic spike on edge e is transmitted independently per connection with probability p_transmit: with that probability the full amplitude weight[e] (pA) is delivered, otherwise nothing. The weight is otherwise static — no per-edge state evolves (the synapse is memoryless).

Parameters:
  • weight (ArrayLike or Quantity, optional) – Per-edge synaptic weight (pA; bare numbers interpreted as pA, sign preserved). Default 1.0 pA.

  • delay (Quantity, optional) – Homogeneous axonal delay; must be finite and strictly positive. Grid quantization is handled by the substrate’s InputDelay. Default 1.0 ms.

  • receptor_type (int, optional) – Postsynaptic receptor port (non-negative integer). Default 0.

  • p_transmit (float, optional) – Spike transmission probability, in [0, 1]. p_transmit = 1 reproduces static_synapse exactly; p_transmit = 0 delivers nothing. Default 1.0.

Raises:

ValueError – If p_transmit is outside [0, 1] (NEST BadProperty), the delay is non-positive/non-finite, or receptor_type < 0.

See also

static_synapse

Deterministic fixed-weight delivery (the p_transmit=1 limit).

quantal_stp_synapse

Probabilistic (binomial) short-term plasticity.

Notes

NEST models/bernoulli_synapse.h send() (lines 164-175) draws one uniform variate u from the per-connection RNG and delivers the full weight iff u < p_transmit_; set_status (lines 214-217) validates p_transmit \in [0, 1].

PRNG carve-out (distributional parity only). NEST draws one Bernoulli per spike from a per-thread RNG; this kernel draws jax.random.uniform(ctx.key, (E,)) < p_transmit — a length-E vector from the substrate’s single per-step key. JAX’s counter-based (threefry) PRNG makes the E draws independent across edges (output position j derives from counter j), so two edges sharing a presynaptic neuron, and multapses, gate independently; across steps the substrate re-splits the key. The streams are not bit-identical to NEST, so parity is distributional (the transmitted fraction converges to p_transmit; the per-step delivered count is Binomial(n_fired, p_transmit)). No per-edge jax.random.split seam is needed — the shape-(E,) draw already supplies edge-axis independence.

References

Examples

>>> import brainunit as u
>>> from brainpy.state import bernoulli_synapse
>>> s = bernoulli_synapse(weight=20.0 * u.pA, p_transmit=0.5)
>>> s.stochastic
True
>>> s.edge_state_init()
{}
>>> float(s.p_transmit)
0.5