bernoulli_synapse#
- class brainpy.state.bernoulli_synapse(*args, **kwargs)#
Static synapse with stochastic (Bernoulli) transmission (NEST
bernoulli_synapse).Each presynaptic spike on edge
eis transmitted independently per connection with probabilityp_transmit: with that probability the full amplitudeweight[e](pA) is delivered, otherwise nothing. The weight is otherwise static — no per-edge state evolves (the synapse is memoryless).- Parameters:
weight (
ArrayLikeorQuantity, optional) – Per-edge synaptic weight (pA; bare numbers interpreted as pA, sign preserved). Default1.0pA.delay (
Quantity, optional) – Homogeneous axonal delay; must be finite and strictly positive. Grid quantization is handled by the substrate’sInputDelay. Default1.0 ms.receptor_type (
int, optional) – Postsynaptic receptor port (non-negative integer). Default0.p_transmit (
float, optional) – Spike transmission probability, in[0, 1].p_transmit = 1reproducesstatic_synapseexactly;p_transmit = 0delivers nothing. Default1.0.
- Raises:
ValueError – If
p_transmitis outside[0, 1](NESTBadProperty), the delay is non-positive/non-finite, orreceptor_type < 0.
See also
static_synapseDeterministic fixed-weight delivery (the
p_transmit=1limit).quantal_stp_synapseProbabilistic (binomial) short-term plasticity.
Notes
NEST
models/bernoulli_synapse.hsend()(lines 164-175) draws one uniform variateufrom the per-connection RNG and delivers the full weight iffu < p_transmit_;set_status(lines 214-217) validatesp_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-Evector from the substrate’s single per-step key. JAX’s counter-based (threefry) PRNG makes theEdraws independent across edges (output positionjderives from counterj), 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 top_transmit; the per-step delivered count isBinomial(n_fired, p_transmit)). No per-edgejax.random.splitseam 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