brainx-skill 1.0.6 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +10 -8
  2. package/adapters/gemini.js +7 -0
  3. package/adapters/opencode.js +7 -0
  4. package/adapters/windsurf.js +7 -0
  5. package/installation/lib/installer.js +4 -1
  6. package/manifest.json +6 -1
  7. package/package.json +8 -2
  8. package/skills/braincell/SKILL.md +182 -0
  9. package/skills/braincell/references/area-scaled-hh-pattern.md +54 -0
  10. package/skills/braincell/references/braincell-custom-ion-channel-authoring.md +273 -0
  11. package/skills/braincell/references/channel-library.md +85 -0
  12. package/skills/braincell/references/ion-library.md +87 -0
  13. package/skills/braincell/references/mixions-for-adaptation.md +81 -0
  14. package/skills/braincell/references/multicompartment/braincell-manual-morphology-construction.md +180 -0
  15. package/skills/braincell/references/multicompartment/cv-policy-reference.md +133 -0
  16. package/skills/braincell/references/multicompartment/filter-function-library.md +154 -0
  17. package/skills/braincell/references/multicompartment/morphology-io-loading-validation.md +135 -0
  18. package/skills/braincell/references/multicompartment/multicompartment-cell-workflow.md +391 -0
  19. package/skills/braincell/references/multicompartment/probe-reference.md +128 -0
  20. package/skills/braincell/references/multicompartment/topology-building-and-visualization.md +260 -0
  21. package/skills/braincell/references/scripts/calcium_channel_gating.py +66 -0
  22. package/skills/braincell/references/scripts/cell_multicompartment_reference.py +221 -0
  23. package/skills/braincell/references/scripts/channel_ablation.py +61 -0
  24. package/skills/braincell/references/scripts/fi_curve.py +68 -0
  25. package/skills/braincell/references/scripts/hh_neuron_basics.py +59 -0
  26. package/skills/braincell/references/scripts/spike_frequency_adaptation.py +75 -0
  27. package/skills/braincell/references/scripts/t_current_rebound.py +72 -0
  28. package/skills/braincell/references/scripts/thalamic_neurons.py +228 -0
  29. package/skills/braincell/references/solver-library-with-effects.md +188 -0
  30. package/skills/brainevent/SKILL.md +268 -0
  31. package/skills/brainevent/references/connectivity-variants.md +312 -0
  32. package/skills/brainevent/references/custom-operators-cpu.md +304 -0
  33. package/skills/brainevent/references/custom-operators-gpu.md +468 -0
  34. package/skills/brainevent/references/scripts/102_EI_net_1996.py +107 -0
  35. package/skills/brainevent/references/scripts/204_joglekar_2018_propagation.py +168 -0
  36. package/skills/brainevent/references/scripts/coba_ei_teaching.py +356 -0
  37. package/skills/brainevent/references/sparse-formats.md +182 -0
  38. package/skills/brainevent/references/synaptic-plasticity.md +285 -0
  39. package/skills/brainmass/SKILL.md +290 -0
  40. package/skills/brainmass/references/batch-transform-acceleration.md +136 -0
  41. package/skills/brainmass/references/brainstate/parameter-constraints-regularization.md +214 -0
  42. package/skills/brainmass/references/brainstate/parameter-transforms-regularizers-catalog.md +171 -0
  43. package/skills/brainmass/references/braintools/cogtask.md +190 -0
  44. package/skills/brainmass/references/braintools/data-preprocessing.md +83 -0
  45. package/skills/brainmass/references/braintools/metric.md +157 -0
  46. package/skills/brainmass/references/braintools/optimizer.md +187 -0
  47. package/skills/brainmass/references/braintools/parameter-initializer.md +187 -0
  48. package/skills/brainmass/references/braintools/surrogate.md +151 -0
  49. package/skills/brainmass/references/coupling-network-api.md +148 -0
  50. package/skills/brainmass/references/datasets-api.md +72 -0
  51. package/skills/brainmass/references/fitting-with-objectives-api.md +146 -0
  52. package/skills/brainmass/references/forward-observation-api.md +131 -0
  53. package/skills/brainmass/references/horn-task-training.md +199 -0
  54. package/skills/brainmass/references/modellibrary.md +104 -0
  55. package/skills/brainmass/references/noiseprocesses.md +121 -0
  56. package/skills/brainmass/references/parameter-sweeps-and-regime-analysis.md +130 -0
  57. package/skills/brainmass/references/scripts/eeg-fitting-with-gradients.py +230 -0
  58. package/skills/brainmass/references/scripts/gradient-free-fitting.py +106 -0
  59. package/skills/brainmass/references/scripts/hopf-bifurcation-single-node.py +78 -0
  60. package/skills/brainmass/references/scripts/horn-cognitive-task-training.py +211 -0
  61. package/skills/brainmass/references/scripts/jansen-rit-eeg-proxy.py +76 -0
  62. package/skills/brainmass/references/scripts/kuramoto-synchronization.py +81 -0
  63. package/skills/brainmass/references/scripts/linear-baseline-node.py +81 -0
  64. package/skills/brainmass/references/scripts/resting-state-meg-whole-brain-pipeline.py +249 -0
  65. package/skills/brainmass/references/scripts/seizure-epileptor-case-study.py +126 -0
  66. package/skills/brainmass/references/scripts/wilson-cowan-ei-dynamics.py +86 -0
  67. package/skills/brainmass/references/scripts/wong-wang-decision-making.py +167 -0
  68. package/skills/brainmass/references/scripts/wong-wang-dmf-resting-state.py +72 -0
  69. package/skills/brainmass/references/visualization-analysis-api.md +130 -0
  70. package/skills/brainpy-state/SKILL.md +232 -0
  71. package/skills/brainpy-state/references/array-creation.md +158 -0
  72. package/skills/brainpy-state/references/brain-dynamics-delay-protocol.md +96 -0
  73. package/skills/brainpy-state/references/braintools/brainstate-control-flow-patterns.md +334 -0
  74. package/skills/brainpy-state/references/braintools/data-preprocessing.md +79 -0
  75. package/skills/brainpy-state/references/braintools/metric.md +152 -0
  76. package/skills/brainpy-state/references/braintools/optimizer.md +179 -0
  77. package/skills/brainpy-state/references/braintools/parameter-initializer.md +183 -0
  78. package/skills/brainpy-state/references/braintools/surrogate.md +147 -0
  79. package/skills/brainpy-state/references/component-selection.md +273 -0
  80. package/skills/brainpy-state/references/nest-compatible/devices.md +157 -0
  81. package/skills/brainpy-state/references/nest-compatible/divergence-and-parity.md +114 -0
  82. package/skills/brainpy-state/references/nest-compatible/integration-categories.md +41 -0
  83. package/skills/brainpy-state/references/nest-compatible/model-library.md +200 -0
  84. package/skills/brainpy-state/references/nest-compatible/nest-workflow.md +156 -0
  85. package/skills/brainpy-state/references/nest-compatible/network-building.md +264 -0
  86. package/skills/brainpy-state/references/nest-compatible/scripts/brette_et_al_2007.py +320 -0
  87. package/skills/brainpy-state/references/nest-compatible/scripts/brunel_alpha.py +108 -0
  88. package/skills/brainpy-state/references/nest-compatible/scripts/brunel_delta.py +93 -0
  89. package/skills/brainpy-state/references/nest-compatible/scripts/clopath_synapse_spike_pairing.py +171 -0
  90. package/skills/brainpy-state/references/nest-compatible/scripts/evaluate_tsodyks2_synapse.py +147 -0
  91. package/skills/brainpy-state/references/nest-compatible/scripts/spatial_gaussex.py +112 -0
  92. package/skills/brainpy-state/references/nest-compatible/scripts/synapsecollection.py +198 -0
  93. package/skills/brainpy-state/references/nest-compatible/synapse-and-connectivity.md +153 -0
  94. package/skills/brainpy-state/references/projection-patterns.md +125 -0
  95. package/skills/brainpy-state/references/scripts/103_COBA_2005.py +86 -0
  96. package/skills/brainpy-state/references/scripts/106_COBA_HH_2007.py +181 -0
  97. package/skills/brainpy-state/references/scripts/107_gamma_oscillation_1996.py +156 -0
  98. package/skills/brainpy-state/references/scripts/109_fast_global_oscillation.py +111 -0
  99. package/skills/brainpy-state/references/scripts/201_surrogate_grad_lif_fashion_mnist.py +221 -0
  100. package/skills/brainpy-state/references/scripts/training-snn.py +119 -0
  101. package/skills/brainstate/SKILL.md +1 -1
  102. package/skills/brainstate/references/brainstate/brainstate-control-flow-patterns.md +250 -399
  103. package/skills/brainstate/references/brainstate/brainstate-transformed-diagnostics.md +6 -2
  104. package/skills/brainstate/references/brainstate/parameter-constraints-regularization.md +16 -2
  105. package/skills/brainstate/references/brainstate/parameter-transforms-regularizers-catalog.md +8 -3
  106. package/skills/brainstate/references/brainstate/randomness-and-reproducibility.md +64 -143
  107. package/skills/brainstate/references/brainstate/transformation-grad-expansion.md +13 -1
  108. package/skills/brainstate/references/brainstate/transformation-jit-expansion.md +11 -1
  109. package/skills/brainstate/references/brainstate/transformation-vmap-expansion.md +35 -7
  110. package/skills/brainstate/references/collective_model_operations.md +9 -9
  111. package/skills/brainstate/references/extension_mechanisms.md +12 -1
  112. package/skills/brainstate/references/libraries/prebuilt-activation-library.md +106 -97
  113. package/skills/brainstate/references/libraries/prebuilt-layer-library.md +102 -176
  114. package/skills/brainstate/references/model-interop-and-migration.md +11 -1
  115. package/skills/brainstate/references/size-inference-variations.md +11 -0
  116. package/skills/brainstate/references/state-graph-operations.md +13 -15
  117. package/skills/brainstate/references/state_collections_and_utilities.md +12 -1
  118. package/skills/brainx-general-guard/SKILL.md +68 -0
  119. package/skills/brainstate/references/braintools-optimizer-reference.md +0 -133
  120. package/skills/brainstate/references/libraries/solver-library-with-effects.md +0 -85
@@ -0,0 +1,273 @@
1
+ # Component selection
2
+
3
+ Use this reference after choosing the native `brainpy.state` path and before constructing the Module graph. Select the least detailed component set that preserves the phenomenon, signal semantics, and decoded result required by the experiment.
4
+
5
+ ## Selection order
6
+
7
+ Choose components in dependency order so later decisions preserve earlier semantics:
8
+
9
+ | Step | Decide | Result |
10
+ |---|---|---|
11
+ | 1 | Which firing mechanism must the neuron reproduce? | Neuron family and required numerical resolution |
12
+ | 2 | Is the presynaptic source scheduled, stochastic, encoded, or injected directly into State? | Input generator or input function |
13
+ | 3 | Which temporal response must a presynaptic event create? | Synaptic dynamics and the valid projection alignment |
14
+ | 4 | Should synaptic activity become voltage-dependent conductance or voltage-independent current? | Synaptic output, weight units, signs, and scale |
15
+ | 5 | Must efficacy change over recent presynaptic history? | Optional `STP` or `STD` |
16
+ | 6 | What tensor and temporal statistic does the loss or analysis consume? | Readout Module or explicit time reduction |
17
+
18
+ After these choices, open `references/projection-patterns.md` to choose AlignPre versus AlignPost, communication, delay integration, and projection construction form.
19
+
20
+ ## Neuron models
21
+
22
+ All native point-neuron models use the same lifecycle: construct a population, initialize its State, call it once per `dt` with input current, and read the current spike with `get_spike()`.
23
+
24
+ ### Minimal integrate-and-fire models
25
+
26
+ Use this family when threshold, reset, leak, and optional refractoriness are sufficient to preserve the required firing behavior.
27
+
28
+ | API | Use when |
29
+ |---|---|
30
+ | `brainpy.state.IF(in_size, R=..., tau=..., V_th=..., ...)` | Use when membrane voltage should integrate input without a leak-to-rest term. |
31
+ | `brainpy.state.LIF(in_size, R=..., tau=..., V_th=..., V_reset=..., V_rest=..., ...)` | Use as the canonical low-cost neuron when leaky voltage integration is required. |
32
+ | `brainpy.state.LIFRef(in_size, R=..., tau=..., tau_ref=..., V_th=..., V_reset=..., V_rest=..., ...)` | Use when the LIF model must enforce an explicit refractory interval after each spike. |
33
+
34
+ ### Nonlinear integrate-and-fire models
35
+
36
+ Use this family when the spike-onset nonlinearity affects the result but adaptation is not required.
37
+
38
+ | API | Use when |
39
+ |---|---|
40
+ | `brainpy.state.ExpIF(in_size, R=..., tau=..., V_T=..., delta_T=..., ...)` | Use when exponential spike initiation must replace the hard LIF onset. |
41
+ | `brainpy.state.ExpIFRef(in_size, R=..., tau=..., tau_ref=..., V_T=..., delta_T=..., ...)` | Use when exponential spike initiation and an explicit refractory interval are both required. |
42
+ | `brainpy.state.QuaIF(in_size, R=..., tau=..., V_c=..., c=..., ...)` | Use when quadratic spike initiation is the required reduced nonlinear model. |
43
+
44
+ ### Adaptive integrate-and-fire models
45
+
46
+ Use this family when recent firing must change threshold or excitability through an adaptation State.
47
+
48
+ | API | Use when |
49
+ |---|---|
50
+ | `brainpy.state.ALIF(in_size, R=..., tau=..., tau_a=..., beta=..., ...)` | Use for low-cost LIF dynamics with a spike-driven adaptive threshold. |
51
+ | `brainpy.state.AdExIF(in_size, R=..., tau=..., tau_w=..., V_T=..., delta_T=..., a=..., b=..., ...)` | Use when exponential spike onset and adaptation current are both required. |
52
+ | `brainpy.state.AdExIFRef(in_size, R=..., tau=..., tau_w=..., tau_ref=..., V_T=..., delta_T=..., a=..., b=..., ...)` | Use when adaptive exponential dynamics must also enforce refractoriness. |
53
+ | `brainpy.state.AdQuaIF(in_size, R=..., tau=..., tau_w=..., V_c=..., c=..., a=..., b=..., ...)` | Use when quadratic spike onset and adaptation current are both required. |
54
+ | `brainpy.state.AdQuaIFRef(in_size, R=..., tau=..., tau_w=..., tau_ref=..., V_c=..., c=..., a=..., b=..., ...)` | Use when adaptive quadratic dynamics must also enforce refractoriness. |
55
+
56
+ ### Generalized integrate-and-fire models
57
+
58
+ Use this family when dynamic threshold and spike-triggered aftercurrents must be represented explicitly.
59
+
60
+ | API | Use when |
61
+ |---|---|
62
+ | `brainpy.state.Gif(in_size, V_th_inf=..., V_th_reset=..., k1=..., k2=..., A1=..., A2=..., ...)` | Use when a generalized integrate-and-fire model must capture threshold adaptation and multiple aftercurrents. |
63
+ | `brainpy.state.GifRef(in_size, tau_ref=..., V_th_inf=..., V_th_reset=..., k1=..., k2=..., A1=..., A2=..., ...)` | Use when generalized integrate-and-fire dynamics must also enforce an explicit refractory interval. |
64
+
65
+ ### Phenomenological firing models
66
+
67
+ Use this family when diverse firing regimes matter but channel-level conductance dynamics do not.
68
+
69
+ | API | Use when |
70
+ |---|---|
71
+ | `brainpy.state.Izhikevich(in_size, a=..., b=..., c=..., d=..., V_th=..., ...)` | Use for rich single-neuron firing patterns at lower cost than conductance-based models. |
72
+ | `brainpy.state.IzhikevichRef(in_size, a=..., b=..., c=..., d=..., V_th=..., tau_ref=..., ...)` | Use when an Izhikevich model must additionally enforce a refractory interval. |
73
+
74
+ ### Conductance-based neuron models
75
+
76
+ Use this family only when voltage-dependent membrane conductances are part of the scientific question; expect higher cost and verify a sufficiently small `dt`.
77
+
78
+ | API | Use when |
79
+ |---|---|
80
+ | `brainpy.state.HH(in_size, ENa=..., gNa=..., EK=..., gK=..., EL=..., gL=..., C=..., ...)` | Use for canonical Hodgkin-Huxley sodium, potassium, and leak conductances. |
81
+ | `brainpy.state.MorrisLecar(in_size, V_Ca=..., g_Ca=..., V_K=..., g_K=..., V_leak=..., g_leak=..., C=..., ...)` | Use for reduced calcium-potassium conductance dynamics with a two-variable phase-plane interpretation. |
82
+ | `brainpy.state.WangBuzsakiHH(in_size, ENa=..., gNa=..., EK=..., gK=..., EL=..., gL=..., C=..., phi=..., ...)` | Use for Wang-Buzsaki fast-spiking interneuron conductance dynamics. |
83
+
84
+ Do not increase model detail as a default. Validate each candidate under its natural parameter scale and the intended driving protocol:
85
+
86
+ ```python
87
+ # Given a fully constructed candidate and a unitful drive:
88
+ with brainstate.environ.context(dt=0.1 * u.ms):
89
+ brainstate.nn.init_all_states(candidate)
90
+ times = u.math.arange(
91
+ 0.0 * u.ms,
92
+ 200.0 * u.ms,
93
+ brainstate.environ.get_dt(),
94
+ )
95
+
96
+ def step(t):
97
+ with brainstate.environ.context(t=t):
98
+ spike = candidate(drive)
99
+ return candidate.V.value, spike
100
+
101
+ voltage, spikes = brainstate.transform.for_loop(step, times)
102
+
103
+ assert voltage.shape[0] == times.shape[0]
104
+ assert spikes.shape == voltage.shape
105
+ ```
106
+
107
+ Compare firing rate, adaptation, spike onset, and stability at the intended `dt`; do not choose from the class name alone.
108
+
109
+ ## Input generators
110
+
111
+ Choose the source from what is already known and where the generated input should be applied.
112
+
113
+ ### Scheduled and autonomous spike sources
114
+
115
+ Use this family when the source owns either a prescribed event schedule or a persistent stochastic firing-rate configuration.
116
+
117
+ | API | Use when |
118
+ |---|---|
119
+ | `brainpy.state.SpikeTime(in_size, indices=..., times=..., weights=True, time_as_step="round", ...)` | Use when event indices and times are data rather than stochastic samples. |
120
+ | `brainpy.state.PoissonSpike(in_size, freqs, spk_type=bool, ...)` | Use when a stateful source should sample one spike vector per update from fixed or callable rates. |
121
+
122
+ ### Rate encoders
123
+
124
+ Use this family when firing rates arrive as call-time data and must be converted into stochastic spikes.
125
+
126
+ | API | Use when |
127
+ |---|---|
128
+ | `brainpy.state.PoissonEncoder(in_size, spk_type=bool, ...)` | Use when each call supplies the rate tensor to encode instead of storing a fixed source rate. |
129
+
130
+ ### Direct Poisson input
131
+
132
+ Use this family when Poisson events should be accumulated directly into a target State rather than emitted as an intermediate spike population.
133
+
134
+ | API | Use when |
135
+ |---|---|
136
+ | `brainpy.state.PoissonInput(target=..., num_input=..., freq=..., weight=..., indices=None, ...)` | Use the Module form when the input configuration and target binding belong in the Module graph. |
137
+ | `brainpy.state.poisson_input(freq, num_input, weight, target, indices=None, refractory=None)` | Use the functional form when the surrounding update workflow already owns the target State and call site. |
138
+
139
+ Keep stochastic and time-dependent inputs inside the same `brainstate.environ.context(dt=..., t=...)` and transformed time loop as the model. Use BrainState randomness when reproducibility or mapped random streams matter.
140
+
141
+ ## Synaptic dynamics
142
+
143
+ Synaptic dynamics determine the temporal filter and constrain valid State alignment.
144
+
145
+ ### Linear synaptic filters
146
+
147
+ Use this family when superposition permits exact AlignPost State and the required response is exponential or alpha-shaped.
148
+
149
+ | API | Use when |
150
+ |---|---|
151
+ | `brainpy.state.Expon(in_size, name=None, tau=..., g_initializer=...)` | Use for the canonical single-exponential decay and AlignPost path. |
152
+ | `brainpy.state.DualExpon(in_size, name=None, tau_decay=..., tau_rise=..., amplitude=..., normalize=True, g_initializer=...)` | Use when distinct rise and decay constants are required while retaining linear-filter alignment. |
153
+ | `brainpy.state.Alpha(in_size, name=None, tau=..., g_initializer=...)` | Use when one time constant and an alpha-shaped response are required. |
154
+
155
+ ### Receptor-kinetic synapses
156
+
157
+ Use this family when transmitter binding introduces nonlinear receptor State; use AlignPre rather than assuming linear AlignPost equivalence.
158
+
159
+ | API | Use when |
160
+ |---|---|
161
+ | `brainpy.state.AMPA(in_size, name=None, alpha=..., beta=..., T=..., T_dur=..., g_initializer=...)` | Use for AMPA receptor binding and unbinding kinetics. |
162
+ | `brainpy.state.GABAa(in_size, name=None, alpha=..., beta=..., T=..., T_dur=..., g_initializer=...)` | Use for GABA-A receptor binding and unbinding kinetics. |
163
+ | `brainpy.state.BioNMDA(in_size, name=None, alpha1=..., beta1=..., alpha2=..., beta2=..., T=..., T_dur=..., g_initializer=..., x_initializer=...)` | Use for biological NMDA kinetics; pair it with a compatible voltage-dependent output when magnesium block matters. |
164
+
165
+ Use `.desc(size, **parameters)` when a projection should construct, own, or merge a compatible component. Instantiate the synapse directly when it is updated independently or intentionally shared outside projection construction.
166
+
167
+ ## Synaptic outputs
168
+
169
+ The output converts the communicated or filtered synaptic value into current received by the target.
170
+
171
+ ### Conductance-based outputs
172
+
173
+ Use this family when postsynaptic voltage and reversal potential must determine synaptic current.
174
+
175
+ | API | Use when |
176
+ |---|---|
177
+ | `brainpy.state.COBA(E=...)` | Use for current `g * (E - V)`; choose the reversal potential for the intended excitatory or inhibitory path. |
178
+ | `brainpy.state.MgBlock(E=..., cc_Mg=..., alpha=..., beta=..., V_offset=...)` | Use for NMDA-like conductance when voltage-dependent magnesium block is part of the response. |
179
+
180
+ ### Current-based outputs
181
+
182
+ Use this family when synaptic current must remain independent of postsynaptic voltage.
183
+
184
+ | API | Use when |
185
+ |---|---|
186
+ | `brainpy.state.CUBA(scale=...)` | Use for voltage-independent current injection; calibrate `scale`, weights, signs, and units for the current-based model. |
187
+
188
+ Changing `COBA` to `CUBA` is not a syntax-only substitution. Recheck weight units, inhibitory sign, magnitude, and network operating point.
189
+
190
+ Subclass `brainpy.state.SynOut` only when the built-ins cannot express the required conductance-to-current rule. Preserve the target neuron's registered-current input contract.
191
+
192
+ ## Short-term plasticity
193
+
194
+ Use this family only when recent presynaptic activity must modulate transmission.
195
+
196
+ | API | Use when |
197
+ |---|---|
198
+ | `brainpy.state.STP(in_size, name=None, U=..., tau_f=..., tau_d=...)` | Use when both facilitation and depression are required; it tracks utilization `u` and available resources `x`. |
199
+ | `brainpy.state.STD(in_size, name=None, tau=..., U=...)` | Use when depression is required without facilitation; it tracks available resources `x`. |
200
+
201
+ Use `.desc(...)` through a functional projection builder's `stp=` argument when plasticity belongs inside projection construction:
202
+
203
+ ```python
204
+ # Given constructed pre/post populations:
205
+ projection = brainpy.state.align_post_projection(
206
+ pre.prefetch("V"),
207
+ lambda voltage: pre.get_spike(voltage) != 0.0,
208
+ comm=brainstate.nn.EventFixedProb(
209
+ n_pre,
210
+ n_post,
211
+ conn_num=0.1,
212
+ conn_weight=0.5 * u.mS,
213
+ ),
214
+ syn=brainpy.state.Expon.desc(n_post, tau=5.0 * u.ms),
215
+ out=brainpy.state.COBA.desc(E=0.0 * u.mV),
216
+ post=post,
217
+ stp=brainpy.state.STP.desc(
218
+ n_pre,
219
+ U=0.2,
220
+ tau_f=1500.0 * u.ms,
221
+ tau_d=200.0 * u.ms,
222
+ ),
223
+ )
224
+
225
+ # Inside update(), before post integrates the current step:
226
+ projection()
227
+ ```
228
+
229
+ Use `STP.desc(n_pre, ...)` for plasticity State aligned to the presynaptic population. Call `STP(...)` or `STD(...)` directly only when inspecting their isolated dynamics. Open `references/projection-patterns.md` for projection selection and update order.
230
+
231
+ ## Readouts and temporal reduction
232
+
233
+ Choose the readout from the target definition, not from convenience.
234
+
235
+ ### Trainable dynamical readouts
236
+
237
+ Use this family when the model must learn a continuous decoding map, optionally with an independently replaceable temporal filter.
238
+
239
+ | API | Use when |
240
+ |---|---|
241
+ | `brainpy.state.LeakyRateReadout(in_size, out_size, tau=..., w_init=..., name=None)` | Use for a single trainable linear decoder with built-in leaky dynamics and per-step continuous output. |
242
+ | `brainstate.nn.Linear(in_size, out_size, w_init=..., b_init=..., ...)` | Use as the mapping stage when decoder weights and temporal filtering must remain separate. |
243
+ | `brainpy.state.Expon(in_size, name=None, tau=..., g_initializer=...)` | Use after a separate linear mapping when the filtered State and its lifecycle must remain independently replaceable. |
244
+
245
+ ### Explicit temporal reductions
246
+
247
+ Use this family when the loss should consume a statistic of per-step spikes or logits rather than a dynamical readout State.
248
+
249
+ | API or expression | Use when |
250
+ |---|---|
251
+ | `u.math.sum(outputs, axis=0)` | Use when the target depends on total spike count or accumulated evidence across time. |
252
+ | `u.math.mean(outputs, axis=0)` | Use when the target depends on a time-normalized rate or average logit. |
253
+ | `outputs[-1]` | Use when the decision is encoded at the final valid step; handle padding and masking before selecting it. |
254
+
255
+ Do not default to time averaging when the label depends on latency, precise timing, or the final State. Open `references/braintools/metric.md` when selecting the loss-facing reduction, `references/braintools/surrogate.md` when gradients cross a spiking nonlinearity, and `references/braintools/brainstate-control-flow-patterns.md` for long-rollout BPTT.
256
+
257
+ ## Boundaries and official sources
258
+
259
+ - Open `references/projection-patterns.md` for communication, alignment, descriptor ownership, delays, short-term plasticity integration, direct input, and electrical coupling.
260
+ - Open `references/braintools/metric.md` for loss and reduction choice, `references/braintools/surrogate.md` for surrogate choice, and `references/braintools/brainstate-control-flow-patterns.md` for loop form and checkpointing.
261
+ - Open `references/nest-compatible/nest-workflow.md` instead when the task uses NEST/PyNEST model names or `Simulator`; do not mix those component APIs into the native path.
262
+
263
+ Official sources:
264
+
265
+ - `https://brainx.chaobrain.com/brainpy-state/brainpy-style/howto/sim-choose-neuron.html`
266
+ - `https://brainx.chaobrain.com/brainpy-state/brainpy-style/howto/sim-coba-cuba-synapses.html`
267
+ - `https://brainx.chaobrain.com/brainpy-state/brainpy-style/howto/sim-short-term-plasticity.html`
268
+ - `https://brainx.chaobrain.com/brainpy-state/apis/brainpy-neurons.html`
269
+ - `https://brainx.chaobrain.com/brainpy-state/apis/brainpy-synapses.html`
270
+ - `https://brainx.chaobrain.com/brainpy-state/apis/brainpy-synouts.html`
271
+ - `https://brainx.chaobrain.com/brainpy-state/apis/brainpy-plasticity.html`
272
+ - `https://brainx.chaobrain.com/brainpy-state/apis/brainpy-inputs.html`
273
+ - `https://brainx.chaobrain.com/brainpy-state/apis/brainpy-readouts.html`
@@ -0,0 +1,157 @@
1
+ # Devices
2
+
3
+ Use this reference when selecting a NEST-compatible generator, recorder, detector, or broadcast device; deciding connection direction; or reading device output from `SimulationResult`.
4
+
5
+ ## Family map
6
+
7
+ Use this map to choose a device family before locating its constructor.
8
+
9
+ | Family | Use when | Key constraint |
10
+ |---|---|---|
11
+ | Current generators | Injecting a current waveform or noise in `pA` | Current enters through the neuron's ring buffer with a one-step delay. |
12
+ | Direct spike generators | Delivering explicit or transformed spike trains | Events use the connection's weight and delay. |
13
+ | Poisson generators | Producing constant, precise, scheduled, or sinusoidal Poisson spikes | NEST and JAX streams require distributional parity. |
14
+ | Other generators | Producing gamma, correlated, dead-time, or pulse-packet trains | One independent train is realized per target. |
15
+ | Recording devices | Recording spikes, analog State, or plastic weights | Direction and registration depend on recorder type. |
16
+ | Detectors | Computing correlation or binary-state statistics | Several detectors execute eagerly on the host. |
17
+ | Broadcast devices | Delivering a shared modulating signal | Bind the broadcast node to the compatible plasticity rule. |
18
+
19
+ ## Current generators
20
+
21
+ Use these constructors when the device must inject a current rather than deliver weighted spike events.
22
+
23
+ | Constructor | Use when |
24
+ |---|---|
25
+ | `sim.create(bp.dc_generator, size=1, params=parameters)` | Use a constant current over a `start`/`stop` window. |
26
+ | `sim.create(bp.ac_generator, size=1, params=parameters)` | Use a sinusoidal current. |
27
+ | `sim.create(bp.noise_generator, size=1, params=parameters)` | Use Gaussian white-noise current with independent target realizations. |
28
+ | `sim.create(bp.step_current_generator, size=1, params=parameters)` | Use a piecewise-constant current schedule. |
29
+ | `sim.create(bp.step_rate_generator, size=1, params=parameters)` | Use a piecewise-constant rate schedule. |
30
+
31
+ Current generators inject through the target's current ring buffer. Do not treat them as weighted spike-event sources.
32
+
33
+ ## Direct spike generators
34
+
35
+ Use these constructors for explicit spike schedules, supplied trains, or spike dilution.
36
+
37
+ | Constructor | Use when |
38
+ |---|---|
39
+ | `sim.create(bp.spike_generator, size=1, params=parameters)` | Use explicit `spike_times`. |
40
+ | `sim.create(bp.spike_train_injector, size=1, params=parameters)` | Use a supplied spike train as an event source. |
41
+ | `sim.create(bp.spike_dilutor, size=1, params=parameters)` | Use NEST-compatible spike dilution. |
42
+
43
+ ## Poisson generators
44
+
45
+ Use these constructors when spike times follow a constant, precise, scheduled, or sinusoidally modulated Poisson process.
46
+
47
+ | Constructor | Use when |
48
+ |---|---|
49
+ | `sim.create(bp.poisson_generator, size=1, params=parameters)` | Use a constant-rate Poisson train over a configured window. |
50
+ | `sim.create(bp.poisson_generator_ps, size=1, params=parameters)` | Use precise-time Poisson spikes with dead time. |
51
+ | `sim.create(bp.inhomogeneous_poisson_generator, size=1, params=parameters)` | Use a time-varying Poisson schedule. |
52
+ | `sim.create(bp.sinusoidal_poisson_generator, size=1, params=parameters)` | Use a sinusoidally modulated Poisson rate. |
53
+
54
+ ## Other generators
55
+
56
+ Use these constructors for gamma-process, correlated, dead-time, or pulse-packet sources.
57
+
58
+ | Constructor | Use when |
59
+ |---|---|
60
+ | `sim.create(bp.gamma_sup_generator, size=1, params=parameters)` | Use a superposition of independent gamma processes. |
61
+ | `sim.create(bp.sinusoidal_gamma_generator, size=1, params=parameters)` | Use a sinusoidally modulated gamma source. |
62
+ | `sim.create(bp.mip_generator, size=1, params=parameters)` | Use correlated trains from a multiple-interaction process. |
63
+ | `sim.create(bp.ppd_sup_generator, size=1, params=parameters)` | Use a superposition of Poisson processes with dead time. |
64
+ | `sim.create(bp.pulsepacket_generator, size=1, params=parameters)` | Use a Gaussian pulse packet. |
65
+
66
+ A generator fans out to one independent train per target neuron. For a multi-channel generator, pass one signed connection weight per channel.
67
+
68
+ ## Recording devices
69
+
70
+ Use these constructors to capture spikes, named analog State, or per-edge plastic weights.
71
+
72
+ | Constructor | Use when |
73
+ |---|---|
74
+ | `sim.create(bp.spike_recorder, size=1)` | Use to record emitted spikes, event counts, or mean population rate. |
75
+ | `sim.create(bp.multimeter, size=1, record_from=recordables, interval=interval)` | Use to sample named analog recordables such as `V_m`. |
76
+ | `sim.create(bp.weight_recorder, size=1, params=parameters)` | Use the NEST-compatible weight-recorder device. |
77
+
78
+ ## Recorder readback
79
+
80
+ Use these methods after `simulate()` or `cont()` to read the in-memory recordings.
81
+
82
+ | API | Use when |
83
+ |---|---|
84
+ | `result.spikes(node)` | Use to return the `(n_steps, n_recorded)` spike matrix for a recorder or source. |
85
+ | `result.rate(node)` | Use to return mean firing rate in spikes per second for a recorder or source. |
86
+ | `result.n_events(node)` | Use to return the number of recorded spike events for a recorder or source. |
87
+ | `result.trace(recorder, recordable="V_m")` | Use to return an analog trace in the recordable's natural unit. |
88
+ | `result.times` | Use to read the common time axis. |
89
+ | `sim.record_weight(proj)` | Use before simulation to register a plastic projection for per-step weight capture. |
90
+ | `result.weight_trace(proj)` | Use after registration to return the `(n_steps, n_edges)` weight trajectory. |
91
+
92
+ ## Detectors
93
+
94
+ Use these constructors to compute correlation or binary-State statistics from recorded trains.
95
+
96
+ | Constructor | Use when |
97
+ |---|---|
98
+ | `sim.create(bp.correlation_detector, size=1, params=parameters)` | Use pairwise correlation statistics. |
99
+ | `sim.create(bp.correlomatrix_detector, size=1, params=parameters)` | Use a correlation matrix. |
100
+ | `sim.create(bp.correlospinmatrix_detector, size=1, params=parameters)` | Use spin-based correlation matrices. |
101
+ | `sim.create(bp.spin_detector, size=1, params=parameters)` | Use binary-State decoding from spikes. |
102
+
103
+ Obtain spike data before driving a detector that uses NumPy randomness or a Python host loop; do not force imperative detector logic into the compiled simulation loop.
104
+
105
+ ## Broadcast devices
106
+
107
+ Use this constructor when dopamine-modulated plasticity needs one shared broadcast signal.
108
+
109
+ | Constructor | Use when |
110
+ |---|---|
111
+ | `sim.create(bp.volume_transmitter, size=1, params=parameters)` | Use to broadcast dopamine State to `stdp_dopamine_synapse`. |
112
+
113
+ ## Device direction
114
+
115
+ Use device role to determine the `connect()` direction.
116
+
117
+ | Connection | Use when |
118
+ |---|---|
119
+ | `sim.connect(generator, neuron)` | Use for current, spike, Poisson, and other source devices. |
120
+ | `sim.connect(neuron, spike_recorder)` | Use to tap emitted spikes. |
121
+ | `sim.connect(multimeter, neuron)` | Use for analog observation; `multimeter` follows NEST's reversed recorder direction. |
122
+ | `sim.connect(dopamine_source, volume_transmitter)` | Use to register the modulating source on a volume transmitter. |
123
+
124
+ ```python
125
+ import brainunit as u
126
+ from brainpy import state as bp
127
+
128
+ sim = bp.Simulator(dt=0.1 * u.ms)
129
+ neuron = sim.create(bp.iaf_psc_exp, 1)
130
+ drive = sim.create(bp.poisson_generator, rate=8000.0 * u.Hz, rng_seed=0)
131
+ spike_recorder = sim.create(bp.spike_recorder)
132
+ meter = sim.create(bp.multimeter, record_from=["V_m"], interval=0.1 * u.ms)
133
+
134
+ sim.connect(drive, neuron, weight=10.0 * u.pA, delay=1.0 * u.ms)
135
+ sim.connect(neuron, spike_recorder)
136
+ sim.connect(meter, neuron)
137
+
138
+ result = sim.simulate(100.0 * u.ms)
139
+ spikes = result.spikes(spike_recorder)
140
+ voltage = result.trace(meter, "V_m")
141
+ ```
142
+
143
+ **Invariant:** Recording is in memory only. Do not port `record_to` file or ASCII backends; read spikes, traces, rates, counts, and weights from `SimulationResult`.
144
+
145
+ ## Common failures
146
+
147
+ - Do not connect `multimeter` as `neuron -> multimeter`; use `multimeter -> neuron`.
148
+ - Do not connect `spike_recorder` as a source; use `neuron -> spike_recorder`.
149
+ - Do not model a current source as a spike source. Current devices inject `pA`; spike sources deliver delayed weighted events.
150
+ - Do not assume one generator object emits one shared train to every target; fan-out realizes independent target trains.
151
+ - Do not call `weight_trace()` without first registering the plastic projection.
152
+ - Do not request an unregistered analog variable; `result.trace()` raises `KeyError`.
153
+
154
+ ## Official sources
155
+
156
+ - https://brainx.chaobrain.com/brainpy-state/nest-style/devices.html
157
+ - https://brainx.chaobrain.com/brainpy-state/apis/nest-devices.html
@@ -0,0 +1,114 @@
1
+ # Divergence and parity
2
+
3
+ Use this reference when porting NEST code, locating plasticity parameters, explaining a NEST mismatch, selecting trace versus distributional comparison, or deciding which documented tolerance and coverage claim applies.
4
+
5
+ ## Divergence map
6
+
7
+ | Divergence | Porting decision | Failure prevented |
8
+ |---|---|---|
9
+ | Learning State location | Move NEST neuron-owned learning parameters to the BrainPy-State synapse spec or broadcast node where documented. | Setting a recognized name on the wrong object and silently changing the learning rule. |
10
+ | Parameter-location maps | Check each STDP or Clopath parameter rather than assuming all parameters move together. | Moving voltage-filter State that must remain on the neuron. |
11
+ | Online versus deferred updates | Compare at the documented event times and use the documented numerical band. | Reporting a known timing residual as an implementation failure. |
12
+ | Device and recording conventions | Preserve analog observer direction, current-versus-spike source semantics, and in-memory readback. | Empty recordings, one-step misalignment, or unsupported file output. |
13
+ | Independent PRNG streams | Compare stochastic drives, random connectivity, and stochastic neurons distributionally across seeds. | Requiring impossible sample-by-sample identity between NEST and JAX. |
14
+
15
+ ## STDP parameter placement
16
+
17
+ BrainPy-State evaluates plasticity kernels every time step on an event-driven substrate. It keeps presynaptic and postsynaptic traces on the plasticity side so rules can run without a NEST archiving-capable postsynaptic neuron.
18
+
19
+ | Parameter or State | NEST location | BrainPy-State location |
20
+ |---|---|---|
21
+ | `tau_minus` for trace-based STDP | Postsynaptic archiving neuron | Synapse spec |
22
+ | `tau_minus_triplet` | Postsynaptic archiving neuron | `stdp_triplet_synapse` spec |
23
+ | `A_LTP`, `A_LTD`, `theta_plus`, `theta_minus` | Clopath-capable postsynaptic neuron | `clopath_synapse` spec |
24
+ | `tau_u_bar_plus`, `tau_u_bar_minus` | Clopath postsynaptic neuron | Remain on the compatible `_clopath` neuron |
25
+ | `delay_u_bars` | Postsynaptic analog ring buffer | `clopath_synapse` spec; the online reader uses a one-step lag |
26
+ | Dopamine level `n` | Per-synapse State | `volume_transmitter` broadcast State |
27
+ | `tau_n` | Common property bound to the transmitter | `volume_transmitter`; the synapse spec value must match |
28
+ | Dopamine STDP weight parameters | Common synapse properties | `stdp_dopamine_synapse` spec |
29
+
30
+ ```python
31
+ # Port tau_minus from the NEST postsynaptic neuron to the synapse spec.
32
+ plasticity = bp.stdp_synapse(
33
+ tau_plus=20.0 * u.ms,
34
+ tau_minus=20.0 * u.ms,
35
+ )
36
+ ```
37
+
38
+ **Invariant:** Move only the parameters named by the location map. Clopath voltage-filter time constants remain neuron State even though Clopath learning amplitudes and thresholds move to the synapse spec.
39
+
40
+ ## Nearest-neighbour STDP conventions
41
+
42
+ Use these constructors when the port requires a specific nearest-neighbour or hardware-emulated STDP pairing convention.
43
+
44
+ | Constructor | Use when |
45
+ |---|---|
46
+ | `bp.stdp_nn_symm_synapse(*args, **kwargs)` | Use when each spike must pair only with the nearest preceding spike on the opposite side. |
47
+ | `bp.stdp_nn_restr_synapse(*args, **kwargs)` | Use symmetric nearest-neighbour pairing with a one-pairing-per-spike availability restriction. |
48
+ | `bp.stdp_nn_pre_centered_synapse(*args, **kwargs)` | Use when a postsynaptic spike must consume all presynaptic spikes accumulated since the preceding postsynaptic spike, while a presynaptic spike pairs with the nearest preceding postsynaptic spike. |
49
+ | `bp.stdp_facetshw_synapse_hom(*args, **kwargs)` | Use when causal and acausal charge must accumulate before quantized LUT readout on the configured cycle. |
50
+
51
+ Do not replace one nearest-neighbour variant with another because their class names look similar; the pairing convention changes the weight trajectory.
52
+
53
+ ## Documented numerical divergences
54
+
55
+ The direction and ordering of each effect remain exact; only the documented magnitude or initialization behavior diverges.
56
+
57
+ | Rule or behavior | Cause | Accepted result |
58
+ |---|---|---|
59
+ | Clopath online LTP | BrainPy-State reads online with an intrinsic one-step lag; NEST reads a delayed analog ring buffer and defers the history sum. | Use `delay_u_bars=0.1 ms` for parity and accept the documented `<= 5%` band; the NEST `4.0 ms` default is not reproduced online. |
60
+ | Dopamine-modulated STDP | BrainPy-State integrates every step; NEST integrates lazily at send/update time. | Accept the documented approximately `0.2%` band while requiring exact direction and ordering. |
61
+ | Nearest-neighbour phantom pre at `t=0` | NEST initializes the first send time at zero; BrainPy-State represents that no real presynaptic spike has occurred. | Do not require the phantom facilitation for `stdp_nn_symm_synapse` or `stdp_nn_restr_synapse`. |
62
+
63
+ For ordinary online-versus-deferred pair STDP, compare weights at presynaptic send times, where the operations coincide.
64
+
65
+ ## Choose the parity mode
66
+
67
+ | Mode | Use when | Compare |
68
+ |---|---|---|
69
+ | Trace | Drive and dynamics are deterministic under the same `dt` and fixed inputs. | Per-sample or maximum absolute error, with an optional one-step recorder alignment. |
70
+ | Distributional | Poisson input, random connectivity, or stochastic neurons use independent NEST and JAX PRNG streams. | Seed-aggregated statistics; use at least five seeds for the documented category-D protocol. |
71
+
72
+ The comparison uses `|actual - reference| <= atol + rtol * |reference|`; do not divide by the reference, because a valid reference can be zero.
73
+
74
+ ## Validation categories
75
+
76
+ Validation categories describe how parity is asserted. They are related to, but distinct from, the integration categories that describe how a model is solved.
77
+
78
+ | Category | Kind | Representative metric | Documented tolerance |
79
+ |---|---|---|---|
80
+ | A | Adaptive numerical integrator | AdEx, HH, or Izhikevich `V_m` trace | Absolute `1e-3 mV` trace tolerance |
81
+ | B | Analytic exact propagator | Linear `iaf_psc_*` voltage or PSC trace | Absolute `1e-6 mV`; aligned variant `5e-2 mV` with at most one step |
82
+ | C | Conductance, coupled, or mean-field | `iaf_cond_*` voltage or `siegert_neuron` rate | `1e-3 mV` trace or `5%` rate |
83
+ | D | PRNG-divergent distribution | Network firing rate or ISI CV | Seed mean within `5%` over at least five seeds |
84
+ | E | Spike time or event count | Precise spiking or PSC peak timing | Event-count difference at most two and step difference at most one |
85
+
86
+ ## Mismatch workflow
87
+
88
+ 1. Confirm that both sides use the same model name, parameter values, physical units, `dt`, connection rule, and device window.
89
+ 2. Check the STDP and Clopath parameter-location map before comparing learning behavior.
90
+ 3. Determine whether the observable is deterministic or PRNG-divergent.
91
+ 4. Select the matching validation category and recorder alignment.
92
+ 5. Compare the same observable at the same lifecycle point; for deferred plasticity, use the documented send-time comparison.
93
+ 6. Apply only a documented band. Do not derive a new tolerance from one run.
94
+ 7. Report known coverage gaps separately from parity failures.
95
+
96
+ Run the live-NEST harness when the package source and NEST are available:
97
+
98
+ ```bash
99
+ python -m pytest brainpy_state/_nest_validation/ -m requires_nest -q
100
+ ```
101
+
102
+ Tests marked `requires_nest` skip when NEST cannot be imported; harness unit tests still run without NEST.
103
+
104
+ ## Known coverage gaps
105
+
106
+ - `iaf_cond_alpha_mc` is not yet validated against NEST; `pp_cond_exp_mc_urbanczik` does have per-compartment parity coverage.
107
+ - File-backed recording is not implemented; use the in-memory `SimulationResult`.
108
+ - Some legacy distributional tests use one realization rather than the documented five-seed protocol.
109
+
110
+ ## Official sources
111
+
112
+ - https://brainx.chaobrain.com/brainpy-state/nest-style/divergences/index.html
113
+ - https://brainx.chaobrain.com/brainpy-state/nest-style/validation-status.html
114
+ - https://brainx.chaobrain.com/brainpy-state/nest-style/divergences/stdp.html
@@ -0,0 +1,41 @@
1
+ # Integration categories
2
+
3
+ Use this reference when determining how a NEST-compatible model family is numerically updated and which parity reference to open next. Integration categories describe how a model is solved; validation categories describe how its output is compared with NEST.
4
+
5
+ ## Category map
6
+
7
+ | Integration category | Numerical behavior | Model families | Downstream decision |
8
+ |---|---|---|---|
9
+ | A | Adaptive Runge-Kutta-Fehlberg (`AdaptiveRungeKuttaStep`) controls local error with internal adaptive steps. | `aeif_*`, `gif_*`, `glif_*`, `iaf_cond_*` | Expect adaptive-integrator trace validation; open `references/nest-compatible/divergence-and-parity.md` for category-A tolerances. |
10
+ | B | Exact analytic propagation over the fixed simulation step; no Runge-Kutta iteration. | `iaf_psc_*`, including alpha, exponential, and delta forms | Expect near-exact deterministic trace parity under matching inputs and `dt`. |
11
+ | C | Adaptive Runge-Kutta-Fehlberg handles Hodgkin-Huxley gating dynamics. | `hh_psc_*`, `hh_cond_*`, `ht_neuron` | Use the documented HH/conductance validation band rather than category-B exactness. |
12
+ | D | A vectorized population update advances rate State each step without a spike-resolved ODE. | `lin_rate_*`, `tanh_rate_*`, `sigmoid_rate_*`, `threshold_lin_rate_*`, `siegert_neuron` | Validate the relevant rate or distributional observable rather than a spike-resolved voltage trace. |
13
+ | E | Discrete update rules run without ODE integration. | Generators, recorders, detectors, static synapses, gap junctions, STP, STDP, voltage-based learning rules | Validate event time/count, distribution, or documented plasticity behavior according to the component. |
14
+
15
+ ## Apply the category
16
+
17
+ 1. Identify the concrete model or component family.
18
+ 2. Use the table to determine the numerical update mechanism.
19
+ 3. Keep the simulation `dt` and device alignment identical when constructing a NEST comparison.
20
+ 4. Open `references/nest-compatible/divergence-and-parity.md` and choose the validation mode and tolerance for the actual observable.
21
+
22
+ Examples:
23
+
24
+ | Model | Integration result | Validation consequence |
25
+ |---|---|---|
26
+ | `iaf_psc_alpha` | Category B analytic propagator | Compare a deterministic trace near-exactly under category B. |
27
+ | `aeif_cond_exp` | Category A adaptive RKF45 | Use the adaptive-integrator trace tolerance. |
28
+ | `hh_cond_exp_traub` | Category C Hodgkin-Huxley RKF45 | Use the documented HH/conductance tolerance. |
29
+ | `lin_rate_ipn` | Category D vectorized rate update | Compare rate behavior; use distributional parity when the drive is stochastic. |
30
+ | `stdp_synapse` | Category E event-driven rule | Compare at the documented event lifecycle point and check STDP divergences. |
31
+
32
+ ## Common failures
33
+
34
+ - Do not infer numerical behavior from `psc` versus `cond` alone without checking the family table.
35
+ - Do not call integration category D "distributional validation category D"; the names align by design but answer different questions.
36
+ - Do not assign one tolerance to every model in an integration family; the observable and stochasticity still determine the validation mode.
37
+ - Do not demand bit-for-bit agreement from an adaptive, stochastic, or event-aligned workflow when the parity reference specifies a trace band, distribution, or event tolerance.
38
+
39
+ ## Official source
40
+
41
+ - https://brainx.chaobrain.com/brainpy-state/nest-style/integration-categories.html