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. Withx_barthe presynaptic trace andV/u_bar_plus/u_bar_minusthe 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_historymultiplies its per-stepdwbyTime::get_resolution()(so the accumulated potentiation is a resolution-independent time integral), whereas the depressiondwapplied at each presynaptic spike has no such factor. The product of rectifiers reproduces NEST’su > theta_plus AND u_bar_plus > theta_minusAND-gate, and the strict NEST inequalities at equality give \([0]_+ = 0\) (no update) — see the boundary edge cases.x_baris the substrate’s per-pre trace divided bytau_x(NEST incrementsx_barby \(1/\tau_x\) per spike, the substrate by 1).- Parameters:
weight (
ArrayLikeorQuantity, optional) – Per-edge weight. Bare numbers default to mV — the reference neuronaeif_psc_delta_clopathis a delta model whose input is a voltage jump; pass an explicit pAQuantityfor the current-basedhh_psc_alpha_clopath. Same sign asWmax/Wminunder NEST’s sign tests. Default1.0mV.delay (
Quantity, optional) – Axonal/dendritic delay (> 0). Default1.0 ms.receptor_type (
int, optional) – Postsynaptic receptor port (>= 0). Default0.tau_x (
Quantity, optional) – Presynaptic trace (x_bar) time constant (> 0); drives the substrate’s per-pre trace seam. Default15.0 ms.Wmax (
float, optional) – Upper / lower weight clamp (pA). Defaults100.0/0.0.Wmin (
float, optional) – Upper / lower weight clamp (pA). Defaults100.0/0.0.A_LTP (
float, optional) – Potentiation / depression amplitudes. Defaults8.0e-5/14.0e-5.A_LTD (
float, optional) – Potentiation / depression amplitudes. Defaults8.0e-5/14.0e-5.theta_plus (
Quantity, optional) – Potentiation / depression voltage thresholds (mV). Defaults-45.3/-70.6mV.theta_minus (
Quantity, optional) – Potentiation / depression voltage thresholds (mV). Defaults-45.3/-70.6mV.
Notes
NEST divergence — parameter location. In NEST,
A_LTD/A_LTP/theta_plus/theta_minusare parameters of the postsynaptic neuron (ClopathArchivingNode), which precomputes the weight change; the synapse stores onlyweight/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 (mirrorsstdp_synapsemovingtau_minusonto the synapse). For parity, the drive sets identical values on the NEST neuron and this spec; the filter time constantstau_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 decayedx_bar); this kernel potentiates eagerly every step. The cumulative weight at each pre spike — where NEST’sweight_recordersamples — 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 instantaneousuwith the delayedu_bar_plus; LTD uses the delayedu_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’sdelay_u_barsto one resolution step.Parity note. The parameter-location moves, the
delay_u_barsdivergence 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