clopath_synapse

Contents

clopath_synapse#

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

Voltage-based spike-timing-dependent plasticity synapse spec (NEST clopath_synapse).

Weight updates follow Clopath et al. (2010): a presynaptic spike depresses the weight by the post neuron’s low-pass filtered voltage above theta_minus, and sustained postsynaptic depolarization potentiates it. With x_bar the presynaptic trace and V / u_bar_plus / u_bar_minus the post neuron’s (filtered) voltages read per edge each step:

\[ \begin{align}\begin{aligned}w \leftarrow \min\!\big(W_{\max},\; w + A_\text{LTP}\, \bar{x}\, [V - \theta_+]_+ \, [\bar{u}_+ - \theta_-]_+ \, \Delta t\big) \quad\text{(every step)}\\w \leftarrow \max\!\big(W_{\min},\; w - A_\text{LTD}\, [\bar{u}_- - \theta_-]_+\big) \quad\text{(pre spike)}\end{aligned}\end{align} \]

where \([x]_+ = \max(x, 0)\). LTP carries a \(\Delta t\) factor, LTD does not. NEST’s write_LTP_history multiplies its per-step dw by Time::get_resolution() (so the accumulated potentiation is a resolution-independent time integral), whereas the depression dw applied at each presynaptic spike has no such factor. The product of rectifiers reproduces NEST’s u > theta_plus AND u_bar_plus > theta_minus AND-gate, and the strict NEST inequalities at equality give \([0]_+ = 0\) (no update) — see the boundary edge cases. x_bar is the substrate’s per-pre trace divided by tau_x (NEST increments x_bar by \(1/\tau_x\) per spike, the substrate by 1).

Parameters:
  • weight (ArrayLike or Quantity, optional) – Per-edge weight. Bare numbers default to mV — the reference neuron aeif_psc_delta_clopath is a delta model whose input is a voltage jump; pass an explicit pA Quantity for the current-based hh_psc_alpha_clopath. Same sign as Wmax/Wmin under NEST’s sign tests. Default 1.0 mV.

  • delay (Quantity, optional) – Axonal/dendritic delay (> 0). Default 1.0 ms.

  • receptor_type (int, optional) – Postsynaptic receptor port (>= 0). Default 0.

  • tau_x (Quantity, optional) – Presynaptic trace (x_bar) time constant (> 0); drives the substrate’s per-pre trace seam. Default 15.0 ms.

  • Wmax (float, optional) – Upper / lower weight clamp (pA). Defaults 100.0 / 0.0.

  • Wmin (float, optional) – Upper / lower weight clamp (pA). Defaults 100.0 / 0.0.

  • A_LTP (float, optional) – Potentiation / depression amplitudes. Defaults 8.0e-5 / 14.0e-5.

  • A_LTD (float, optional) – Potentiation / depression amplitudes. Defaults 8.0e-5 / 14.0e-5.

  • theta_plus (Quantity, optional) – Potentiation / depression voltage thresholds (mV). Defaults -45.3 / -70.6 mV.

  • theta_minus (Quantity, optional) – Potentiation / depression voltage thresholds (mV). Defaults -45.3 / -70.6 mV.

Notes

NEST divergence — parameter location. In NEST, A_LTD/A_LTP/ theta_plus/theta_minus are parameters of the postsynaptic neuron (ClopathArchivingNode), which precomputes the weight change; the synapse stores only weight/x_bar/tau_x/Wmin/Wmax. Here the spec+rule is self-contained, so these four amplitudes/thresholds are synapse-spec attributes that the kernel reads against the post neuron’s filtered voltages (mirrors stdp_synapse moving tau_minus onto the synapse). For parity, the drive sets identical values on the NEST neuron and this spec; the filter time constants tau_u_bar_* remain post-neuron parameters.

Online vs deferred. NEST defers potentiation (it accumulates an LTP history and applies it at the next pre send, weighted by the decayed x_bar); this kernel potentiates eagerly every step. The cumulative weight at each pre spike — where NEST’s weight_recorder samples — coincides.

Delayed reads (``delay_u_bars``). NEST’s archiving node gates and evaluates LTP/LTD against the post voltages delayed by delay_u_bars (a ring buffer): LTP uses the instantaneous u with the delayed u_bar_plus; LTD uses the delayed u_bar_minus. This kernel reads the post neuron’s current State with the substrate’s intrinsic one-step lag (projections run before neurons), so live parity aligns NEST’s delay_u_bars to one resolution step.

Parity note. The parameter-location moves, the delay_u_bars divergence and its 5 % band, and the parity test are documented in STDP parity: where state lives and how spikes pair (Parameter-location map for the STDP family, Documented numerical divergences).

References

Examples

>>> import brainunit as u
>>> from brainpy.state import clopath_synapse
>>> s = clopath_synapse(weight=0.5, tau_x=15.0 * u.ms)
>>> s.is_homogeneous_weight, s.post_state_reads
(False, ('u_bar_minus', 'u_bar_plus', 'V'))
>>> s.post_trace_tau, s.edge_state_init()
(None, {})
>>> float(u.Quantity(s.pre_trace_tau).to_decimal(u.ms))
15.0