volume_transmitter#

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

Dopamine broadcast node (NEST volume_transmitter), JAX-native rebuild.

Collects dopaminergic spikes from one or more bound sources and maintains the neuromodulator concentration n(t) exposed to every dopamine-modulated synapse as a single broadcast scalar. Each step advances n by NEST’s update_dopamine_ recursion (stdp_dopamine_synapse.h:419-425):

\[n \leftarrow n \, e^{-\Delta t / \tau_n} \;+\; \frac{c}{\tau_n},\]

where \(c\) is the number of dopaminergic spikes delivered this step (summed over all bound sources) and \(\tau_n\) the concentration time constant. The increment carries no \(\Delta t\) factor (it is multiplicity / tau_n per spike, exactly as in NEST); the decay alone carries the step.

Parameters:
  • in_size (Size, optional) – Number of independent broadcast channels; n has shape (in_size,). Independent transmitters are normally separate nodes, so the default 1 is the common case. Default 1.

  • tau_n (Quantity or float, optional) – Dopamine concentration time constant (> 0). Bare numbers are interpreted as milliseconds. Must equal the dopamine synapse spec’s tau_n (see module note). Default 200.0 ms.

  • deliver_interval (int, optional) – NEST trigger period (in units of min_delay). Accepted for NEST-API parity and validated >= 1, but a no-op in the online integration scheme (the weight integral runs every step, so there is no batched delivery). Default 1.

  • name (str, optional) – Optional node name. Default None.

n#

The broadcast dopamine concentration, shape (in_size,), init 0.0.

Type:

brainstate.HiddenState

tau_n#

The concentration time constant in ms.

Type:

brainunit.Quantity

deliver_interval#

The accepted (no-op) NEST delivery period.

Type:

int

See also

brainpy_state._nest_plasticity.stdp_dopamine_synapse.stdp_dopamine_synapse

reads n.

Notes

A dopa source is bound with bind_dopa() (the Simulator wires this from connect(dopa_pool, vt)): each binding is a (reader, local_idx) pair where reader() returns the source population’s per-step spike vector and local_idx selects the dopaminergic entries. The per-step count is sum_sources sum(reader()[local_idx]). The bound reader carries the substrate’s intrinsic one-step lag (a dopa neuron firing at step j is read at step j+1), matching NEST’s +1 delivery stamp (volume_transmitter.cpp:113).

References

Examples

Advance n one step after a single dopaminergic spike (\(n = 1/\tau_n = 0.005\) for tau_n = 200 ms):

>>> import brainstate
>>> import jax.numpy as jnp
>>> import brainunit as u
>>> from brainpy.state import volume_transmitter
>>> with brainstate.environ.context(dt=1.0 * u.ms):
...     vt = volume_transmitter(1, tau_n=200.0 * u.ms)
...     holder = brainstate.ShortTermState(jnp.zeros(1))
...     vt.bind_dopa(lambda: holder.value, jnp.array([0]))
...     _ = brainstate.nn.init_all_states(vt)
...     holder.value = jnp.asarray([1.0])
...     with brainstate.environ.context(t=0.0 * u.ms, i=0):
...         _ = vt.update()
...     round(float(vt.n.value[0]), 4)
0.005
bind_dopa(reader, local_idx)[source]#

Register a dopaminergic spike source read each step.

Parameters:
  • reader (callable) – Zero-argument callable returning the source population’s per-step spike vector (the Simulator passes a holder reader).

  • local_idx (ArrayLike) – Indices into reader() selecting this transmitter’s dopaminergic entries; their spikes are summed into the per-step count.

init_state(batch_size=None, **kwargs)[source]#

Allocate the broadcast concentration n (shape (in_size,), init 0).

reset_state(batch_size=None, **kwargs)[source]#

Reset the broadcast concentration n to 0.0.

update()[source]#

Advance n by one step from the bound dopa spike count.

Returns:

The updated broadcast concentration n (shape (in_size,)).

Return type:

jax.Array