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
Kplusis per-edge: it decays attau_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 accumulatedKplus(then erases it); a pre spike depresses with the nearest preceding post (substrate'nearest'K-). The weight maps are those ofstdp_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
Kplusbefore adding this step’s+1, so a pre coinciding with a post is excluded from that step’s facilitation — the second-latest convention ofstdp_nn_pre_centered_synapse.h:63-67. This also makes the model immune to the phantom-pre-at-0 (facilitation isKplus·exp, andKplusstarts 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-allstdp_synapse, the post-triggered reset means earlier pres are forgotten after each post.- Parameters:
weight (
ArrayLikeorQuantity, optional) – Per-edge weight (pA; bare numbers are pA). Same sign asWmax. Default1.0pA.delay (
Quantity, optional) – Homogeneous axonal delay (> 0). Default1.0 ms.receptor_type (
int, optional) – Postsynaptic receptor port (>= 0). Default0.tau_plus (
Quantity, optional) – PresynapticK+trace constant (> 0). Default20.0 ms.tau_minus (
Quantity, optional) – PostsynapticK-trace constant (> 0). Default20.0 ms.lambda (
float, optional) – Learning rate \(\lambda\). Default0.01.alpha (
float, optional) – Depression asymmetry \(\alpha\). Default1.0.mu_plus (
float, optional) – Potentiation/depression exponents (0additive,1multiplicative soft-bound). Default1.0.mu_minus (
float, optional) – Potentiation/depression exponents (0additive,1multiplicative soft-bound). Default1.0.Wmax (
float, optional) – Weight bound (same sign asweight). Default100.0.Kplus (
float, optional) – Initial per-edgeK+(>= 0). Default0.0(NEST default).
Notes
NEST divergence — ``tau_minus`` location. In NEST
tau_minusis a parameter of the postsynaptic neuron (ArchivingNode), not the synapse; here it drives the substrate’s per-postK-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 zeroesKplusafter that first post). The op sets coincide at the pre-spike (send) steps theweight_recordersamples.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}