stdp_triplet_synapse

stdp_triplet_synapse#

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

Triplet spike-timing-dependent plasticity synapse spec (NEST stdp_triplet_synapse).

Four traces drive the rule — a fast/slow pair on each side, all decay-then-add on the substrate (current spike included):

  • r1 (pre, tau_plus), r2 (pre, tau_plus_triplet);

  • o1 (post, tau_minus), o2 (post, tau_minus_triplet).

The kernel gates its own weight writeback — the online all-to-all scheme equal to NEST’s deferred send() at every send (pre-spike) time:

\[\begin{split}w &\leftarrow \min\!\big(w + r_1 (A_2^+ + A_3^+\, o_2),\ W_{\max}\big) \quad\text{(post spike)} \\ w &\leftarrow \max\!\big(w - o_1 (A_2^- + A_3^-\, r_2),\ 0\big) \quad\text{(pre spike)}\end{split}\]

matching NEST facilitate_/depress_: potentiation reads the fast pre trace r1 weighted by the slow post trace o2; depression reads the fast post trace o1 weighted by the slow pre trace r2. The slow trace on the triggering side is taken just before the current spike’s own increment (the t-epsilon of the triplet rule), realised by excluding the current step’s spike from every trace (r = pre_traces - pre_spike, o = post_traces - post_spike).

Parameters:
  • weight (ArrayLike or Quantity, optional) – Per-edge weight (pA; bare numbers are pA). Default 1.0 pA.

  • delay (Quantity, optional) – Homogeneous axonal delay (> 0). Default 1.0 ms.

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

  • tau_plus (Quantity, optional) – Fast presynaptic trace r1 constant (> 0). Default 16.8 ms.

  • tau_plus_triplet (Quantity, optional) – Slow presynaptic trace r2 constant (> 0). Default 101.0 ms.

  • tau_minus (Quantity, optional) – Fast postsynaptic trace o1 constant (> 0). Default 20.0 ms.

  • tau_minus_triplet (Quantity, optional) – Slow postsynaptic trace o2 constant (> 0). Default 110.0 ms.

  • Aplus (float, optional) – Pair potentiation amplitude \(A_2^+\). Default 5e-10.

  • Aplus_triplet (float, optional) – Triplet potentiation amplitude \(A_3^+\). Default 0.0062.

  • Aminus (float, optional) – Pair depression amplitude \(A_2^-\). Default 0.007.

  • Aminus_triplet (float, optional) – Triplet depression amplitude \(A_3^-\). Default 0.00023.

  • Wmax (float, optional) – Upper weight bound (depression floors at 0). Default 100.0.

  • Kplus (float, optional) – Initial fast pre trace r1 (the substrate seeds traces at 0, the NEST default). Default 0.0.

  • Kplus_triplet (float, optional) – Initial slow pre trace r2 (seeded at 0). Default 0.0.

Notes

NEST divergence — ``tau_minus`` / ``tau_minus_triplet`` location. In NEST both postsynaptic trace constants live on the postsynaptic neuron (ArchivingNode), not the synapse; here they are synapse-spec attributes driving the substrate’s per-post o1 / o2 trace columns, so the triplet rule runs standalone.

Online vs deferred: the substrate potentiates eagerly at post-spike steps, whereas NEST defers it to the next pre spike; the two coincide at pre-spike (send) times, so parity is asserted there.

Parity note. The consolidated trace-storage and parameter-location reference (both post-trace constants move onto the synapse) and the parity-test links are in STDP parity: where state lives and how spikes pair (Trace storage: tau_minus is a synapse parameter here, a neuron parameter in NEST).

References

Examples

>>> import brainunit as u
>>> from brainpy.state import stdp_triplet_synapse
>>> s = stdp_triplet_synapse(weight=5.0)
>>> s.is_homogeneous_weight, s.edge_state_init()
(False, {})
>>> len(s.pre_trace_tau), len(s.post_trace_tau)        # fast + slow per side
(2, 2)
>>> float(u.Quantity(s.pre_trace_tau[1]).to_decimal(u.ms))
101.0