stdp_nn_symm_synapse

stdp_nn_symm_synapse#

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

Symmetric nearest-neighbour STDP synapse spec (NEST stdp_nn_symm_synapse).

Both the per-pre K+ and per-post K- traces run in the substrate’s 'nearest' mode — each resets to 1 on its own spike and decays otherwise (tau_plus / tau_minus) — so the value gathered at a partner spike is the single nearest preceding pairing, not the all-to-all sum. The kernel is the same as stdp_synapse:

\[ \begin{align}\begin{aligned}\hat w \leftarrow \hat w + \lambda (1-\hat w)^{\mu_+} K^+ \quad\text{(post spike)}\\\hat w \leftarrow \hat w - \alpha \lambda \hat w^{\mu_-} K^- \quad\text{(pre spike)}\end{aligned}\end{align} \]

with \(\hat w = w/W_{\max}\), the weight clamped to \([0, W_{\max}]\) inside each update (NEST facilitate_/depress_, stdp_nn_symm_synapse.h:210-227). Each side excludes the current step’s own spike (K+ = pre_trace - pre_spike, K- = post_trace - post_spike): in the nearest mode this recovers the second-latest preceding partner when a pair coincides exactly, matching NEST’s “pairs exactly coinciding … are discarded; paired with the second latest” convention (stdp_nn_symm_synapse.h:60-64).

Parameters:
  • weight (ArrayLike or Quantity, optional) – Per-edge weight (pA; bare numbers are pA). Same sign as Wmax. 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) – Presynaptic K+ trace constant (> 0). Default 20.0 ms.

  • tau_minus (Quantity, optional) – Postsynaptic K- trace constant (> 0). Default 20.0 ms.

  • lambda (float, optional) – Learning rate \(\lambda\). Default 0.01.

  • alpha (float, optional) – Depression asymmetry \(\alpha\). Default 1.0.

  • mu_plus (float, optional) – Potentiation/depression exponents (0 additive, 1 multiplicative soft-bound). Default 1.0.

  • mu_minus (float, optional) – Potentiation/depression exponents (0 additive, 1 multiplicative soft-bound). Default 1.0.

  • Wmax (float, optional) – Weight bound (same sign as weight). Default 100.0.

Notes

NEST divergence — ``tau_minus`` location. In NEST tau_minus is a parameter of the postsynaptic neuron (ArchivingNode), not the synapse; here it is a synapse-spec attribute driving the substrate’s per-post K- trace, so STDP runs standalone. The live-NEST parity drive sets the post node’s tau_minus to match.

No ``Kplus`` parameter. Unlike stdp_synapse, the symmetric scheme has no accumulating presynaptic trace to seed — the substrate resets K+ to 1 on each pre spike — so Kplus is intentionally absent from the constructor (it was dropped from the public API in the legacy model too).

The kernel is identical to stdp_synapse; the nearest-neighbour behaviour lives entirely in the substrate trace mode. 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 exact nearest-neighbour pairing convention, the NEST source citation, and the single-pair regression test are documented in STDP parity: where state lives and how spikes pair (stdp_nn_symm_synapse — symmetric nearest-neighbour).

References

Examples

>>> import brainunit as u
>>> from brainpy.state import stdp_nn_symm_synapse
>>> s = stdp_nn_symm_synapse(weight=1.0, tau_plus=20.0 * u.ms)
>>> s.is_homogeneous_weight, s.edge_state_init()
(False, {})
>>> s.pre_trace_mode, s.post_trace_mode
('nearest', 'nearest')