stdp_nn_pre_centered_synapse

stdp_nn_pre_centered_synapse#

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

Presynaptic-centered nearest-neighbour STDP synapse spec (NEST stdp_nn_pre_centered_synapse).

The presynaptic trace Kplus is per-edge: it decays at tau_plus, increments by 1 on each pre spike, and resets to 0 on each post spike, so it holds the sum of all pres since the previous post. A post spike facilitates with that accumulated Kplus (then erases it); a pre spike depresses with the nearest preceding post (substrate 'nearest' K-). The weight maps are those of 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}\), clamped to \([0, W_{\max}]\). The kernel decays Kplus before adding this step’s +1, so a pre coinciding with a post is excluded from that step’s facilitation — the second-latest convention of stdp_nn_pre_centered_synapse.h:63-67. This also makes the model immune to the phantom-pre-at-0 (facilitation is Kplus·exp, and Kplus starts at 0).

Divergences: vs stdp_nn_symm_synapse, a post pairs with the sum of pres since the last post (not just the nearest); vs all-to-all stdp_synapse, the post-triggered reset means earlier pres are forgotten after each post.

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.

  • Kplus (float, optional) – Initial per-edge K+ (>= 0). Default 0.0 (NEST default).

Notes

NEST divergence — ``tau_minus`` location. In NEST tau_minus is a parameter of the postsynaptic neuron (ArchivingNode), not the synapse; here it drives the substrate’s per-post K- trace.

The eager substrate applies potentiation at post-spike steps and depression at pre-spike steps; NEST defers both to the next send (facilitating only the first post since the last pre, which equals the eager scheme because the reset zeroes Kplus after that first post). The op sets coincide at the pre-spike (send) steps the weight_recorder samples.

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_pre_centered_synapse — presynaptic-centered nearest-neighbour).

References

Examples

>>> import brainunit as u
>>> from brainpy.state import stdp_nn_pre_centered_synapse
>>> s = stdp_nn_pre_centered_synapse(weight=1.0, tau_plus=20.0 * u.ms)
>>> s.post_trace_mode, s.pre_trace_tau
('nearest', None)
>>> s.edge_state_init()
{'Kplus': 0.0}