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 advancesnby NEST’supdate_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_nper spike, exactly as in NEST); the decay alone carries the step.- Parameters:
in_size (
Size, optional) – Number of independent broadcast channels;nhas shape(in_size,). Independent transmitters are normally separate nodes, so the default1is the common case. Default1.tau_n (
Quantityorfloat, optional) – Dopamine concentration time constant (> 0). Bare numbers are interpreted as milliseconds. Must equal the dopamine synapse spec’stau_n(see module note). Default200.0 ms.deliver_interval (
int, optional) – NEST trigger period (in units ofmin_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). Default1.name (
str, optional) – Optional node name. DefaultNone.
- n#
The broadcast dopamine concentration, shape
(in_size,), init0.0.- Type:
brainstate.HiddenState
- tau_n#
The concentration time constant in ms.
- Type:
brainunit.Quantity
See also
brainpy_state._nest_plasticity.stdp_dopamine_synapse.stdp_dopamine_synapsereads
n.
Notes
A dopa source is bound with
bind_dopa()(theSimulatorwires this fromconnect(dopa_pool, vt)): each binding is a(reader, local_idx)pair wherereader()returns the source population’s per-step spike vector andlocal_idxselects the dopaminergic entries. The per-step count issum_sources sum(reader()[local_idx]). The bound reader carries the substrate’s intrinsic one-step lag (a dopa neuron firing at stepjis read at stepj+1), matching NEST’s+1delivery stamp (volume_transmitter.cpp:113).References
Examples
Advance
none step after a single dopaminergic spike (\(n = 1/\tau_n = 0.005\) fortau_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 intoreader()selecting this transmitter’s dopaminergic entries; their spikes are summed into the per-step count.