brainx-skill 1.0.15 → 1.0.16
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.
- package/README.md +17 -1
- package/manifest.json +1 -1
- package/mcp-servers/codex/skills.json +1 -1
- package/package.json +1 -1
- package/skills/bio-neuro-lit/SKILL.md +4 -2
- package/skills/bio-neuro-lit/references/required-supplements.md +27 -0
- package/skills/brainx-acceleration/SKILL.md +30 -437
- package/skills/brainx-acceleration/references/audit-and-rewrite-patterns.md +326 -0
- package/skills/brainx-general-guard/SKILL.md +24 -8
- package/skills/brainx-install/SKILL.md +3 -3
- package/skills/brainx-install/references/compatibility-and-release-matching.md +28 -20
- package/skills/brainx-install/references/uninstall-and-cleanup.md +11 -4
- package/skills/brainx-modeling-loop/SKILL.md +117 -36
- package/skills/brainx-modeling-loop/agents/openai.yaml +2 -2
- package/skills/brainx-modeling-loop/references/mechanism-comparison.md +62 -0
- package/skills/brainx-modeling-loop/references/multiscale-coupling.md +16 -0
- package/skills/brainx-modeling-loop/references/paper-reproduction.md +42 -0
- package/skills/brainx-modeling-loop/references/parameter-fitting-workflow.md +14 -14
- package/skills/brainx-modeling-loop/references/run-experiment.md +1 -1
- package/skills/brainx-modeling-loop/references/training-workflow.md +10 -8
- package/skills/brainx-visualization/SKILL.md +6 -2
- package/skills/brainx-visualization/references/neural-data-visualization.md +1 -1
- package/skills/brainx-visualization/references/statistical-and-model-visualization.md +1 -1
- package/skills/package-skills/braincell/SKILL.md +23 -14
- package/skills/package-skills/braincell/references/braintools/input-current.md +1 -1
- package/skills/package-skills/braincell/references/braintools/metric.md +72 -46
- package/skills/package-skills/braincell/references/mixions-for-adaptation.md +1 -1
- package/skills/package-skills/braincell/references/multicompartment/braincell-manual-morphology-construction.md +1 -1
- package/skills/package-skills/braincell/references/multicompartment/cv-policy-reference.md +1 -1
- package/skills/package-skills/braincell/references/multicompartment/filter-function-library.md +3 -3
- package/skills/package-skills/braincell/references/multicompartment/morphology-io-loading-validation.md +1 -1
- package/skills/package-skills/braincell/references/multicompartment/multicompartment-cell-workflow.md +31 -43
- package/skills/package-skills/braincell/references/multicompartment/network-workflow.md +49 -0
- package/skills/package-skills/braincell/references/multicompartment/probe-reference.md +26 -114
- package/skills/package-skills/braincell/references/multicompartment/topology-building-and-visualization.md +40 -28
- package/skills/package-skills/braincell/references/scripts/cell_multicompartment_reference.py +13 -17
- package/skills/package-skills/brainevent/SKILL.md +0 -3
- package/skills/package-skills/brainevent/references/synaptic-plasticity.md +1 -1
- package/skills/package-skills/brainmass/SKILL.md +5 -3
- package/skills/package-skills/brainmass/references/brainstate/parameter-constraints-regularization.md +9 -7
- package/skills/package-skills/brainmass/references/brainstate/parameter-transforms-regularizers-catalog.md +4 -4
- package/skills/package-skills/brainmass/references/braintools/data-preprocessing.md +15 -7
- package/skills/package-skills/brainmass/references/braintools/metric.md +72 -46
- package/skills/package-skills/brainmass/references/coupling-network-api.md +3 -1
- package/skills/package-skills/brainmass/references/fitting-with-objectives-api.md +6 -6
- package/skills/package-skills/brainmass/references/horn-task-training.md +9 -9
- package/skills/package-skills/brainmass/references/modellibrary.md +12 -10
- package/skills/package-skills/brainmass/references/scripts/resting-state-meg-whole-brain-pipeline.py +5 -3
- package/skills/package-skills/brainmass/references/scripts/wilson-cowan-ei-dynamics.py +10 -6
- package/skills/package-skills/brainmass/references/simulator-input-monitor-api.md +3 -1
- package/skills/package-skills/brainmass/references/visualization-analysis-api.md +17 -9
- package/skills/package-skills/brainspike/SKILL.md +201 -0
- package/skills/package-skills/brainspike/references/braintools/connectivity.md +40 -0
- package/skills/package-skills/brainspike/references/braintools/data-preprocessing.md +39 -0
- package/skills/package-skills/brainspike/references/braintools/input-current.md +55 -0
- package/skills/package-skills/brainspike/references/braintools/metric.md +36 -0
- package/skills/package-skills/brainspike/references/braintools/optimizer.md +50 -0
- package/skills/package-skills/brainspike/references/braintools/parameter-initializer.md +43 -0
- package/skills/package-skills/brainspike/references/braintools/surrogate.md +40 -0
- package/skills/package-skills/brainspike/references/migration-boundary.md +38 -0
- package/skills/package-skills/brainspike/references/model-and-readout-selection.md +41 -0
- package/skills/package-skills/brainspike/references/multirate-coupling.md +31 -0
- package/skills/package-skills/brainspike/references/multiscale-composition.md +28 -0
- package/skills/package-skills/brainspike/references/native-composition.md +52 -0
- package/skills/package-skills/brainspike/references/native-delays.md +34 -0
- package/skills/package-skills/brainspike/references/native-projections.md +43 -0
- package/skills/package-skills/brainspike/references/native-training.md +36 -0
- package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/devices.md +33 -33
- package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/divergence-and-parity.md +15 -15
- package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/integration-categories.md +1 -1
- package/skills/package-skills/brainspike/references/nest-compatible/model-library.md +200 -0
- package/skills/package-skills/brainspike/references/nest-compatible/network-building.md +276 -0
- package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/brette_et_al_2007.py +23 -26
- package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/brunel_alpha.py +18 -21
- package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/brunel_delta.py +16 -19
- package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/clopath_synapse_spike_pairing.py +11 -12
- package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/evaluate_tsodyks2_synapse.py +10 -11
- package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/spatial_gaussex.py +18 -18
- package/skills/package-skills/{brainpy-state → brainspike}/references/nest-compatible/scripts/synapsecollection.py +26 -29
- package/skills/package-skills/brainspike/references/nest-compatible/synapse-and-connectivity.md +166 -0
- package/skills/package-skills/brainspike/references/nest-delay-boundaries.md +31 -0
- package/skills/package-skills/brainspike/references/nonlinear-state-sharing.md +26 -0
- package/skills/package-skills/{brainpy-state → brainspike}/references/perturbation-experiment-validity.md +2 -2
- package/skills/package-skills/brainspike/references/simulator-training.md +61 -0
- package/skills/package-skills/brainspike/references/temporal-task-training.md +36 -0
- package/skills/package-skills/brainspike/scripts/advanced_native_patterns.py +76 -0
- package/skills/package-skills/brainspike/scripts/delay_workflow.py +44 -0
- package/skills/package-skills/brainspike/scripts/delayed_cue_training.py +78 -0
- package/skills/package-skills/brainspike/scripts/lif_smoke.py +31 -0
- package/skills/package-skills/brainspike/scripts/multiscale_workflow.py +35 -0
- package/skills/package-skills/brainspike/scripts/native_ei_network.py +47 -0
- package/skills/package-skills/brainspike/scripts/native_workflows.py +77 -0
- package/skills/package-skills/brainspike/scripts/nest_boundary_workflows.py +108 -0
- package/skills/package-skills/brainspike/scripts/train_native_snn.py +65 -0
- package/skills/package-skills/brainspike/scripts/train_nest_simulator.py +69 -0
- package/skills/package-skills/brainspike/scripts/train_nest_simulator_two_weights.py +220 -0
- package/skills/package-skills/brainstate/SKILL.md +16 -21
- package/skills/package-skills/brainstate/references/brainstate/brainstate-control-flow-patterns.md +1 -138
- package/skills/package-skills/brainstate/references/brainstate/brainstate-transformed-diagnostics.md +1 -1
- package/skills/package-skills/brainstate/references/brainstate/delay-buffers.md +45 -0
- package/skills/package-skills/brainstate/references/brainstate/parameter-constraints-regularization.md +9 -7
- package/skills/package-skills/brainstate/references/brainstate/parameter-transforms-regularizers-catalog.md +4 -4
- package/skills/package-skills/brainstate/references/brainstate/randomness-and-reproducibility.md +6 -4
- package/skills/package-skills/brainstate/references/brainstate/transformation-grad-expansion.md +4 -4
- package/skills/package-skills/brainstate/references/brainstate/transformation-vmap-expansion.md +1 -1
- package/skills/package-skills/brainstate/references/braintools-optimizer-reference.md +16 -0
- package/skills/package-skills/brainstate/references/libraries/prebuilt-layer-library.md +1 -1
- package/skills/package-skills/brainstate/references/simulation-environment.md +5 -5
- package/skills/package-skills/braintrace/SKILL.md +17 -38
- package/skills/package-skills/braintrace/references/Drtrl.md +9 -26
- package/skills/package-skills/braintrace/references/algorithm selection.md +7 -12
- package/skills/package-skills/braintrace/references/batching.md +15 -35
- package/skills/package-skills/braintrace/references/compiler_internal.md +1 -1
- package/skills/package-skills/braintrace/references/custom algorithms.md +1 -2
- package/skills/package-skills/braintrace/references/customizing_primitive_transforms.md +26 -15
- package/skills/package-skills/braintrace/references/pp_pprop workflow.md +5 -139
- package/skills/package-skills/brainunit/SKILL.md +7 -2
- package/skills/package-skills/brainunit/references/array-mechanics/functional-structural-api.md +1 -1
- package/skills/package-skills/brainunit/references/math-function-library.md +2 -2
- package/skills/package-skills/brainunit/references/typing-and-runtime-validation.md +5 -2
- package/skills/package-skills/brainevent/references/scripts/102_EI_net_1996.py +0 -107
- package/skills/package-skills/brainevent/references/scripts/204_joglekar_2018_propagation.py +0 -168
- package/skills/package-skills/brainevent/references/scripts/coba_ei_teaching.py +0 -356
- package/skills/package-skills/brainpy-state/SKILL.md +0 -247
- package/skills/package-skills/brainpy-state/references/array-creation.md +0 -158
- package/skills/package-skills/brainpy-state/references/brain-dynamics-delay-protocol.md +0 -147
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/analysis.md +0 -150
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/brainpy legacy workflow.md +0 -373
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/built-in dynamic neuron model.md +0 -150
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/connecting neurons.md +0 -175
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/customize neuron and synpase.md +0 -286
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/Input generation.md +0 -111
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/More about simulation.md +0 -163
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/Multi-device array sharding.md +0 -113
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/Parallel experiment execution.md +0 -136
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/array creation and mechanics.md +0 -222
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/brainpy math environment setting.md +0 -123
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/delays.md +0 -107
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/infrastructure/object oriented transformations and control flows.md +0 -185
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/integrators.md +0 -181
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/route activity through connectivity.md +0 -102
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/synaptic projections.md +0 -147
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/synpase properties.md +0 -159
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/loss library.md +0 -127
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/optimizers.md +0 -167
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/parameter initializers.md +0 -107
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/prebuilt neural network layers.md +0 -186
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/surrogate gradients.md +0 -104
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/trainer library.md +0 -89
- package/skills/package-skills/brainpy-state/references/brainPy(legacy)/training/trainingworkflows.md +0 -253
- package/skills/package-skills/brainpy-state/references/braintools/brainstate-control-flow-patterns.md +0 -334
- package/skills/package-skills/brainpy-state/references/braintools/connectivity.md +0 -206
- package/skills/package-skills/brainpy-state/references/braintools/data-preprocessing.md +0 -79
- package/skills/package-skills/brainpy-state/references/braintools/input-current.md +0 -199
- package/skills/package-skills/brainpy-state/references/braintools/metric.md +0 -152
- package/skills/package-skills/brainpy-state/references/braintools/optimizer.md +0 -179
- package/skills/package-skills/brainpy-state/references/braintools/parameter-initializer.md +0 -183
- package/skills/package-skills/brainpy-state/references/braintools/surrogate.md +0 -147
- package/skills/package-skills/brainpy-state/references/component-selection.md +0 -288
- package/skills/package-skills/brainpy-state/references/nest-compatible/model-library.md +0 -200
- package/skills/package-skills/brainpy-state/references/nest-compatible/nest-workflow.md +0 -156
- package/skills/package-skills/brainpy-state/references/nest-compatible/network-building.md +0 -264
- package/skills/package-skills/brainpy-state/references/nest-compatible/synapse-and-connectivity.md +0 -153
- package/skills/package-skills/brainpy-state/references/projection-patterns.md +0 -127
- package/skills/package-skills/brainpy-state/references/scripts/103_COBA_2005.py +0 -86
- package/skills/package-skills/brainpy-state/references/scripts/106_COBA_HH_2007.py +0 -181
- package/skills/package-skills/brainpy-state/references/scripts/107_gamma_oscillation_1996.py +0 -156
- package/skills/package-skills/brainpy-state/references/scripts/109_fast_global_oscillation.py +0 -111
- package/skills/package-skills/brainpy-state/references/scripts/201_surrogate_grad_lif_fashion_mnist.py +0 -221
- package/skills/package-skills/brainpy-state/references/scripts/sound_localization.py +0 -240
- package/skills/package-skills/brainpy-state/references/scripts/training-snn.py +0 -119
|
@@ -1,288 +0,0 @@
|
|
|
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 drive a direct current protocol, scheduled or stochastic spike source, encoded value, or direct State injection? | BrainTools current protocol, BrainPy input generator, encoder, or input function |
|
|
13
|
-
| 3 | Which presynaptic/postsynaptic pairs exist, and does geometry or topology determine them? | Connection topology and a `ConnectionResult` when BrainTools owns pair selection |
|
|
14
|
-
| 4 | Which temporal response must a presynaptic event create? | Synaptic dynamics and the valid projection alignment |
|
|
15
|
-
| 5 | Should synaptic activity become voltage-dependent conductance or voltage-independent current? | Synaptic output, weight units, signs, and scale |
|
|
16
|
-
| 6 | Must efficacy change over recent presynaptic history? | Optional `STP` or `STD` |
|
|
17
|
-
| 7 | What tensor and temporal statistic does the loss or analysis consume? | Readout Module or explicit time reduction |
|
|
18
|
-
|
|
19
|
-
Complete steps 3 through 6 whenever a point-neuron task names recurrent excitation, mutual inhibition, or spike-driven connectivity. Use explicit synapses, outputs, communication, and projections; do not substitute a scalar mean-spike feedback `State`. If scalar population rates and rate coupling are the scientific variables, route that scale to BrainMass or open both skills for an explicit hybrid model.
|
|
20
|
-
|
|
21
|
-
When geometry, spatial distance, graph topology, Dale's principle, or compartment targeting determines the edge set, open `references/braintools/connectivity.md` and generate the `ConnectionResult` before selecting CSR, CSC, dense, generated, or fixed-degree BrainEvent storage. Let a projection communication operator own pair selection only when its documented fixed-probability or fixed-degree contract expresses the intended topology directly.
|
|
22
|
-
|
|
23
|
-
After these choices, open `references/projection-patterns.md` to choose AlignPre versus AlignPost, communication, delay integration, and projection construction form.
|
|
24
|
-
|
|
25
|
-
## Neuron models
|
|
26
|
-
|
|
27
|
-
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()`.
|
|
28
|
-
|
|
29
|
-
### Minimal integrate-and-fire models
|
|
30
|
-
|
|
31
|
-
Use this family when threshold, reset, leak, and optional refractoriness are sufficient to preserve the required firing behavior.
|
|
32
|
-
|
|
33
|
-
| API | Use when |
|
|
34
|
-
|---|---|
|
|
35
|
-
| `brainpy.state.IF(in_size, R=..., tau=..., V_th=..., ...)` | Use when membrane voltage should integrate input without a leak-to-rest term. |
|
|
36
|
-
| `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. |
|
|
37
|
-
| `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. |
|
|
38
|
-
|
|
39
|
-
### Nonlinear integrate-and-fire models
|
|
40
|
-
|
|
41
|
-
Use this family when the spike-onset nonlinearity affects the result but adaptation is not required.
|
|
42
|
-
|
|
43
|
-
| API | Use when |
|
|
44
|
-
|---|---|
|
|
45
|
-
| `brainpy.state.ExpIF(in_size, R=..., tau=..., V_T=..., delta_T=..., ...)` | Use when exponential spike initiation must replace the hard LIF onset. |
|
|
46
|
-
| `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. |
|
|
47
|
-
| `brainpy.state.QuaIF(in_size, R=..., tau=..., V_c=..., c=..., ...)` | Use when quadratic spike initiation is the required reduced nonlinear model. |
|
|
48
|
-
|
|
49
|
-
### Adaptive integrate-and-fire models
|
|
50
|
-
|
|
51
|
-
Use this family when recent firing must change threshold or excitability through an adaptation State.
|
|
52
|
-
|
|
53
|
-
| API | Use when |
|
|
54
|
-
|---|---|
|
|
55
|
-
| `brainpy.state.ALIF(in_size, R=..., tau=..., tau_a=..., beta=..., ...)` | Use for low-cost LIF dynamics with a spike-driven adaptive threshold. |
|
|
56
|
-
| `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. |
|
|
57
|
-
| `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. |
|
|
58
|
-
| `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. |
|
|
59
|
-
| `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. |
|
|
60
|
-
|
|
61
|
-
### Generalized integrate-and-fire models
|
|
62
|
-
|
|
63
|
-
Use this family when dynamic threshold and spike-triggered aftercurrents must be represented explicitly.
|
|
64
|
-
|
|
65
|
-
| API | Use when |
|
|
66
|
-
|---|---|
|
|
67
|
-
| `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. |
|
|
68
|
-
| `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. |
|
|
69
|
-
|
|
70
|
-
### Phenomenological firing models
|
|
71
|
-
|
|
72
|
-
Use this family when diverse firing regimes matter but channel-level conductance dynamics do not.
|
|
73
|
-
|
|
74
|
-
| API | Use when |
|
|
75
|
-
|---|---|
|
|
76
|
-
| `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. |
|
|
77
|
-
| `brainpy.state.IzhikevichRef(in_size, a=..., b=..., c=..., d=..., V_th=..., tau_ref=..., ...)` | Use when an Izhikevich model must additionally enforce a refractory interval. |
|
|
78
|
-
|
|
79
|
-
### Conductance-based neuron models
|
|
80
|
-
|
|
81
|
-
Use this family only when voltage-dependent membrane conductances are part of the scientific question; expect higher cost and verify a sufficiently small `dt`.
|
|
82
|
-
|
|
83
|
-
| API | Use when |
|
|
84
|
-
|---|---|
|
|
85
|
-
| `brainpy.state.HH(in_size, ENa=..., gNa=..., EK=..., gK=..., EL=..., gL=..., C=..., ...)` | Use for canonical Hodgkin-Huxley sodium, potassium, and leak conductances. |
|
|
86
|
-
| `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. |
|
|
87
|
-
| `brainpy.state.WangBuzsakiHH(in_size, ENa=..., gNa=..., EK=..., gK=..., EL=..., gL=..., C=..., phi=..., ...)` | Use for Wang-Buzsaki fast-spiking interneuron conductance dynamics. |
|
|
88
|
-
|
|
89
|
-
Do not increase model detail as a default. Validate each candidate under its natural parameter scale and the intended driving protocol:
|
|
90
|
-
|
|
91
|
-
```python
|
|
92
|
-
# Given a fully constructed candidate and a unitful drive:
|
|
93
|
-
with brainstate.environ.context(dt=0.1 * u.ms):
|
|
94
|
-
brainstate.nn.init_all_states(candidate)
|
|
95
|
-
times = u.math.arange(
|
|
96
|
-
0.0 * u.ms,
|
|
97
|
-
200.0 * u.ms,
|
|
98
|
-
brainstate.environ.get_dt(),
|
|
99
|
-
)
|
|
100
|
-
|
|
101
|
-
def step(t):
|
|
102
|
-
with brainstate.environ.context(t=t):
|
|
103
|
-
spike = candidate(drive)
|
|
104
|
-
return candidate.V.value, spike
|
|
105
|
-
|
|
106
|
-
voltage, spikes = brainstate.transform.for_loop(step, times)
|
|
107
|
-
|
|
108
|
-
assert voltage.shape[0] == times.shape[0]
|
|
109
|
-
assert spikes.shape == voltage.shape
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Compare firing rate, adaptation, spike onset, and stability at the intended `dt`; do not choose from the class name alone.
|
|
113
|
-
|
|
114
|
-
## Input generators
|
|
115
|
-
|
|
116
|
-
Choose the source from what is already known and where the generated input should be applied.
|
|
117
|
-
|
|
118
|
-
### Direct current protocols
|
|
119
|
-
|
|
120
|
-
Use a BrainTools current protocol when known time-varying values should enter a neuron's current argument rather than emit spikes or mutate target State.
|
|
121
|
-
|
|
122
|
-
| API family | Use when |
|
|
123
|
-
|---|---|
|
|
124
|
-
| `braintools.input` | Use for unit-aware constant sections, steps, pulses, waveforms, stochastic current processes, and composed protocols; generate a time-major array under the intended `brainstate.environ.dt`. |
|
|
125
|
-
|
|
126
|
-
Open `references/braintools/input-current.md` for API selection, composition, and the BrainPy-State rollout handoff. Generate the complete time-major current once under the rollout `dt`, pass it as an `xs` argument to `for_loop`, and apply spatial masks through unit-aware broadcasting after each sample is sliced. Do not rebuild named sections or pulses from time predicates inside the model step.
|
|
127
|
-
|
|
128
|
-
### Scheduled and autonomous spike sources
|
|
129
|
-
|
|
130
|
-
Use this family when the source owns either a prescribed event schedule or a persistent stochastic firing-rate configuration.
|
|
131
|
-
|
|
132
|
-
| API | Use when |
|
|
133
|
-
|---|---|
|
|
134
|
-
| `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. |
|
|
135
|
-
| `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. |
|
|
136
|
-
|
|
137
|
-
### Rate encoders
|
|
138
|
-
|
|
139
|
-
Use this family when firing rates arrive as call-time data and must be converted into stochastic spikes.
|
|
140
|
-
|
|
141
|
-
| API | Use when |
|
|
142
|
-
|---|---|
|
|
143
|
-
| `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. |
|
|
144
|
-
|
|
145
|
-
### Direct Poisson input
|
|
146
|
-
|
|
147
|
-
Use this family when Poisson events should be accumulated directly into a target State rather than emitted as an intermediate spike population.
|
|
148
|
-
|
|
149
|
-
| API | Use when |
|
|
150
|
-
|---|---|
|
|
151
|
-
| `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. |
|
|
152
|
-
| `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. |
|
|
153
|
-
|
|
154
|
-
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.
|
|
155
|
-
|
|
156
|
-
## Synaptic dynamics
|
|
157
|
-
|
|
158
|
-
Synaptic dynamics determine the temporal filter and constrain valid State alignment.
|
|
159
|
-
|
|
160
|
-
### Linear synaptic filters
|
|
161
|
-
|
|
162
|
-
Use this family when superposition permits exact AlignPost State and the required response is exponential or alpha-shaped.
|
|
163
|
-
|
|
164
|
-
| API | Use when |
|
|
165
|
-
|---|---|
|
|
166
|
-
| `brainpy.state.Expon(in_size, name=None, tau=..., g_initializer=...)` | Use for the canonical single-exponential decay and AlignPost path. |
|
|
167
|
-
| `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. |
|
|
168
|
-
| `brainpy.state.Alpha(in_size, name=None, tau=..., g_initializer=...)` | Use when one time constant and an alpha-shaped response are required. |
|
|
169
|
-
|
|
170
|
-
### Receptor-kinetic synapses
|
|
171
|
-
|
|
172
|
-
Use this family when transmitter binding introduces nonlinear receptor State; use AlignPre rather than assuming linear AlignPost equivalence.
|
|
173
|
-
|
|
174
|
-
| API | Use when |
|
|
175
|
-
|---|---|
|
|
176
|
-
| `brainpy.state.AMPA(in_size, name=None, alpha=..., beta=..., T=..., T_dur=..., g_initializer=...)` | Use for AMPA receptor binding and unbinding kinetics. |
|
|
177
|
-
| `brainpy.state.GABAa(in_size, name=None, alpha=..., beta=..., T=..., T_dur=..., g_initializer=...)` | Use for GABA-A receptor binding and unbinding kinetics. |
|
|
178
|
-
| `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. |
|
|
179
|
-
|
|
180
|
-
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.
|
|
181
|
-
|
|
182
|
-
## Synaptic outputs
|
|
183
|
-
|
|
184
|
-
The output converts the communicated or filtered synaptic value into current received by the target.
|
|
185
|
-
|
|
186
|
-
### Conductance-based outputs
|
|
187
|
-
|
|
188
|
-
Use this family when postsynaptic voltage and reversal potential must determine synaptic current.
|
|
189
|
-
|
|
190
|
-
| API | Use when |
|
|
191
|
-
|---|---|
|
|
192
|
-
| `brainpy.state.COBA(E=...)` | Use for current `g * (E - V)`; choose the reversal potential for the intended excitatory or inhibitory path. |
|
|
193
|
-
| `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. |
|
|
194
|
-
|
|
195
|
-
### Current-based outputs
|
|
196
|
-
|
|
197
|
-
Use this family when synaptic current must remain independent of postsynaptic voltage.
|
|
198
|
-
|
|
199
|
-
| API | Use when |
|
|
200
|
-
|---|---|
|
|
201
|
-
| `brainpy.state.CUBA(scale=...)` | Use for voltage-independent current injection; calibrate `scale`, weights, signs, and units for the current-based model. |
|
|
202
|
-
|
|
203
|
-
Changing `COBA` to `CUBA` is not a syntax-only substitution. Recheck weight units, inhibitory sign, magnitude, and network operating point.
|
|
204
|
-
|
|
205
|
-
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.
|
|
206
|
-
|
|
207
|
-
## Short-term plasticity
|
|
208
|
-
|
|
209
|
-
Use this family only when recent presynaptic activity must modulate transmission.
|
|
210
|
-
|
|
211
|
-
| API | Use when |
|
|
212
|
-
|---|---|
|
|
213
|
-
| `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`. |
|
|
214
|
-
| `brainpy.state.STD(in_size, name=None, tau=..., U=...)` | Use when depression is required without facilitation; it tracks available resources `x`. |
|
|
215
|
-
|
|
216
|
-
Use `.desc(...)` through a functional projection builder's `stp=` argument when plasticity belongs inside projection construction:
|
|
217
|
-
|
|
218
|
-
```python
|
|
219
|
-
# Given constructed pre/post populations:
|
|
220
|
-
projection = brainpy.state.align_post_projection(
|
|
221
|
-
pre.prefetch("V"),
|
|
222
|
-
lambda voltage: pre.get_spike(voltage) != 0.0,
|
|
223
|
-
comm=brainstate.nn.EventFixedProb(
|
|
224
|
-
n_pre,
|
|
225
|
-
n_post,
|
|
226
|
-
conn_num=0.1,
|
|
227
|
-
conn_weight=0.5 * u.mS,
|
|
228
|
-
),
|
|
229
|
-
syn=brainpy.state.Expon.desc(n_post, tau=5.0 * u.ms),
|
|
230
|
-
out=brainpy.state.COBA.desc(E=0.0 * u.mV),
|
|
231
|
-
post=post,
|
|
232
|
-
stp=brainpy.state.STP.desc(
|
|
233
|
-
n_pre,
|
|
234
|
-
U=0.2,
|
|
235
|
-
tau_f=1500.0 * u.ms,
|
|
236
|
-
tau_d=200.0 * u.ms,
|
|
237
|
-
),
|
|
238
|
-
)
|
|
239
|
-
|
|
240
|
-
# Inside update(), before post integrates the current step:
|
|
241
|
-
projection()
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
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.
|
|
245
|
-
|
|
246
|
-
## Readouts and temporal reduction
|
|
247
|
-
|
|
248
|
-
Choose the readout from the target definition, not from convenience.
|
|
249
|
-
|
|
250
|
-
### Trainable dynamical readouts
|
|
251
|
-
|
|
252
|
-
Use this family when the model must learn a continuous decoding map, optionally with an independently replaceable temporal filter.
|
|
253
|
-
|
|
254
|
-
| API | Use when |
|
|
255
|
-
|---|---|
|
|
256
|
-
| `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. |
|
|
257
|
-
| `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. |
|
|
258
|
-
| `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. |
|
|
259
|
-
|
|
260
|
-
### Explicit temporal reductions
|
|
261
|
-
|
|
262
|
-
Use this family when the loss should consume a statistic of per-step spikes or logits rather than a dynamical readout State.
|
|
263
|
-
|
|
264
|
-
| API or expression | Use when |
|
|
265
|
-
|---|---|
|
|
266
|
-
| `u.math.sum(outputs, axis=0)` | Use when the target depends on total spike count or accumulated evidence across time. |
|
|
267
|
-
| `u.math.mean(outputs, axis=0)` | Use when the target depends on a time-normalized rate or average logit. |
|
|
268
|
-
| `outputs[-1]` | Use when the decision is encoded at the final valid step; handle padding and masking before selecting it. |
|
|
269
|
-
|
|
270
|
-
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.
|
|
271
|
-
|
|
272
|
-
## Boundaries and official sources
|
|
273
|
-
|
|
274
|
-
- Open `references/projection-patterns.md` for communication, alignment, descriptor ownership, delays, short-term plasticity integration, direct input, and electrical coupling.
|
|
275
|
-
- 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.
|
|
276
|
-
- 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.
|
|
277
|
-
|
|
278
|
-
Official sources:
|
|
279
|
-
|
|
280
|
-
- `https://brainx.chaobrain.com/brainpy-state/brainpy-style/howto/sim-choose-neuron.html`
|
|
281
|
-
- `https://brainx.chaobrain.com/brainpy-state/brainpy-style/howto/sim-coba-cuba-synapses.html`
|
|
282
|
-
- `https://brainx.chaobrain.com/brainpy-state/brainpy-style/howto/sim-short-term-plasticity.html`
|
|
283
|
-
- `https://brainx.chaobrain.com/brainpy-state/apis/brainpy-neurons.html`
|
|
284
|
-
- `https://brainx.chaobrain.com/brainpy-state/apis/brainpy-synapses.html`
|
|
285
|
-
- `https://brainx.chaobrain.com/brainpy-state/apis/brainpy-synouts.html`
|
|
286
|
-
- `https://brainx.chaobrain.com/brainpy-state/apis/brainpy-plasticity.html`
|
|
287
|
-
- `https://brainx.chaobrain.com/brainpy-state/apis/brainpy-inputs.html`
|
|
288
|
-
- `https://brainx.chaobrain.com/brainpy-state/apis/brainpy-readouts.html`
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
# Model library
|
|
2
|
-
|
|
3
|
-
Use this reference when selecting a NEST-compatible neuron family, locating an exact `brainpy.state` model name, or recognizing the model-specific capability that changes construction or routing. Use upstream NEST documentation for equations, parameter meanings, physiology, and scientific references.
|
|
4
|
-
|
|
5
|
-
All constructor rows use the canonical `Simulator.create()` surface. Pass a reusable NEST-style parameter mapping with `params=parameters`, or replace it with explicit keyword parameters.
|
|
6
|
-
|
|
7
|
-
## Current-based IAF neurons
|
|
8
|
-
|
|
9
|
-
Use these models for linear integrate-and-fire dynamics driven by postsynaptic currents; choose delta, alpha, exponential, precise-spiking, or multisynapse behavior from the requested NEST model.
|
|
10
|
-
|
|
11
|
-
| Constructor | Use when |
|
|
12
|
-
|---|---|
|
|
13
|
-
| `sim.create(bp.iaf_psc_delta, size, params=parameters)` | Use delta-shaped input that produces an instantaneous membrane-voltage jump. |
|
|
14
|
-
| `sim.create(bp.iaf_psc_delta_ps, size, params=parameters)` | Use delta input with precise spike timing between grid points. |
|
|
15
|
-
| `sim.create(bp.iaf_psc_alpha, size, params=parameters)` | Use alpha-shaped excitatory and inhibitory current kernels. |
|
|
16
|
-
| `sim.create(bp.iaf_psc_alpha_multisynapse, size, params=parameters)` | Use alpha currents with multiple receptor ports or time constants. |
|
|
17
|
-
| `sim.create(bp.iaf_psc_alpha_ps, size, params=parameters)` | Use alpha currents with precise spike timing. |
|
|
18
|
-
| `sim.create(bp.iaf_psc_exp, size, params=parameters)` | Use exponential postsynaptic-current kernels. |
|
|
19
|
-
| `sim.create(bp.iaf_psc_exp_multisynapse, size, params=parameters)` | Use exponential currents with multiple receptor ports or time constants. |
|
|
20
|
-
| `sim.create(bp.iaf_psc_exp_htum, size, params=parameters)` | Use the NEST `iaf_psc_exp_htum` variant required by the model being ported. |
|
|
21
|
-
| `sim.create(bp.iaf_psc_exp_ps, size, params=parameters)` | Use exponential currents with precise spike timing. |
|
|
22
|
-
| `sim.create(bp.iaf_psc_exp_ps_lossless, size, params=parameters)` | Use exponential precise-spiking dynamics with lossless spike detection. |
|
|
23
|
-
|
|
24
|
-
**Invariant:** Use voltage weights such as `mV` for `iaf_psc_delta`; alpha and exponential current-event examples use current weights such as `pA`.
|
|
25
|
-
|
|
26
|
-
## Conductance-based IAF neurons
|
|
27
|
-
|
|
28
|
-
Use these models when synaptic input changes conductance rather than adding a postsynaptic current.
|
|
29
|
-
|
|
30
|
-
| Constructor | Use when |
|
|
31
|
-
|---|---|
|
|
32
|
-
| `sim.create(bp.iaf_cond_alpha, size, params=parameters)` | Use alpha-shaped synaptic conductances. |
|
|
33
|
-
| `sim.create(bp.iaf_cond_alpha_mc, size, params=parameters)` | Use the multi-compartment alpha-conductance variant; check parity coverage before claiming NEST validation. |
|
|
34
|
-
| `sim.create(bp.iaf_cond_beta, size, params=parameters)` | Use beta-shaped synaptic conductances. |
|
|
35
|
-
| `sim.create(bp.iaf_cond_exp, size, params=parameters)` | Use exponential synaptic conductances. |
|
|
36
|
-
| `sim.create(bp.iaf_cond_exp_sfa_rr, size, params=parameters)` | Use exponential conductances with spike-frequency adaptation and relative refractory dynamics. |
|
|
37
|
-
|
|
38
|
-
## Specialized IAF neurons
|
|
39
|
-
|
|
40
|
-
Use these APIs only when the requested paper or source NEST model names the specialized variant.
|
|
41
|
-
|
|
42
|
-
| Constructor | Use when |
|
|
43
|
-
|---|---|
|
|
44
|
-
| `sim.create(bp.iaf_bw_2001, size, params=parameters)` | Use the NEST-compatible `iaf_bw_2001` model. |
|
|
45
|
-
| `sim.create(bp.iaf_bw_2001_exact, size, params=parameters)` | Use the exact per-synapse NMDA form of `iaf_bw_2001`. |
|
|
46
|
-
| `sim.create(bp.iaf_chs_2007, size, params=parameters)` | Use the `iaf_chs_2007` spike-response model. |
|
|
47
|
-
| `sim.create(bp.iaf_chxk_2008, size, params=parameters)` | Use alpha synapses with the `iaf_chxk_2008` precise AHP timing. |
|
|
48
|
-
| `sim.create(bp.iaf_tum_2000, size, params=parameters)` | Use the `iaf_tum_2000` neuron required by the port. |
|
|
49
|
-
|
|
50
|
-
## Adaptive exponential IF neurons
|
|
51
|
-
|
|
52
|
-
Use these APIs for Brette-Gerstner adaptive exponential dynamics, selecting current versus conductance input and any required astrocyte, multisynapse, or Clopath interface.
|
|
53
|
-
|
|
54
|
-
| Constructor | Use when |
|
|
55
|
-
|---|---|
|
|
56
|
-
| `sim.create(bp.aeif_cond_alpha, size, params=parameters)` | Use adaptive exponential dynamics with alpha-shaped conductances. |
|
|
57
|
-
| `sim.create(bp.aeif_cond_alpha_astro, size, params=parameters)` | Use the astrocyte-compatible alpha-conductance variant. |
|
|
58
|
-
| `sim.create(bp.aeif_cond_alpha_multisynapse, size, params=parameters)` | Use alpha conductances with multiple receptor ports. |
|
|
59
|
-
| `sim.create(bp.aeif_cond_beta_multisynapse, size, params=parameters)` | Use beta conductances with multiple receptor ports. |
|
|
60
|
-
| `sim.create(bp.aeif_cond_exp, size, params=parameters)` | Use adaptive exponential dynamics with exponential conductances. |
|
|
61
|
-
| `sim.create(bp.aeif_psc_alpha, size, params=parameters)` | Use adaptive exponential dynamics with alpha-shaped currents. |
|
|
62
|
-
| `sim.create(bp.aeif_psc_delta, size, params=parameters)` | Use adaptive exponential dynamics with delta input. |
|
|
63
|
-
| `sim.create(bp.aeif_psc_delta_clopath, size, params=parameters)` | Use delta input while exposing the voltage filters consumed by `clopath_synapse`. |
|
|
64
|
-
| `sim.create(bp.aeif_psc_exp, size, params=parameters)` | Use adaptive exponential dynamics with exponential currents. |
|
|
65
|
-
|
|
66
|
-
## Generalized IF neurons
|
|
67
|
-
|
|
68
|
-
Use these APIs for generalized integrate-and-fire dynamics, choosing current versus conductance input, population dynamics, or multiple synaptic time constants.
|
|
69
|
-
|
|
70
|
-
| Constructor | Use when |
|
|
71
|
-
|---|---|
|
|
72
|
-
| `sim.create(bp.gif_cond_exp, size, params=parameters)` | Use conductance-based GIF dynamics with exponential synapses. |
|
|
73
|
-
| `sim.create(bp.gif_cond_exp_multisynapse, size, params=parameters)` | Use conductance-based GIF dynamics with multiple synaptic time constants. |
|
|
74
|
-
| `sim.create(bp.gif_pop_psc_exp, size, params=parameters)` | Use population GIF dynamics with exponential postsynaptic currents. |
|
|
75
|
-
| `sim.create(bp.gif_psc_exp, size, params=parameters)` | Use current-based GIF dynamics with exponential postsynaptic currents. |
|
|
76
|
-
| `sim.create(bp.gif_psc_exp_multisynapse, size, params=parameters)` | Use current-based GIF dynamics with multiple synaptic time constants. |
|
|
77
|
-
|
|
78
|
-
## Generalized LIF neurons
|
|
79
|
-
|
|
80
|
-
Use these APIs for Allen Institute generalized leaky integrate-and-fire dynamics.
|
|
81
|
-
|
|
82
|
-
| Constructor | Use when |
|
|
83
|
-
|---|---|
|
|
84
|
-
| `sim.create(bp.glif_cond, size, params=parameters)` | Use conductance-based GLIF dynamics. |
|
|
85
|
-
| `sim.create(bp.glif_psc, size, params=parameters)` | Use current-based GLIF dynamics. |
|
|
86
|
-
| `sim.create(bp.glif_psc_double_alpha, size, params=parameters)` | Use current-based GLIF dynamics with double-alpha postsynaptic currents. |
|
|
87
|
-
|
|
88
|
-
## Multi-timescale adaptive-threshold neurons
|
|
89
|
-
|
|
90
|
-
Use these APIs when the requested NEST model uses MAT or adaptive MAT threshold dynamics.
|
|
91
|
-
|
|
92
|
-
| Constructor | Use when |
|
|
93
|
-
|---|---|
|
|
94
|
-
| `sim.create(bp.mat2_psc_exp, size, params=parameters)` | Use the two-timescale MAT model with exponential currents. |
|
|
95
|
-
| `sim.create(bp.amat2_psc_exp, size, params=parameters)` | Use the adaptive MAT variant with exponential currents. |
|
|
96
|
-
|
|
97
|
-
## Hodgkin-Huxley neurons
|
|
98
|
-
|
|
99
|
-
Use these APIs for biophysical conductance-based dynamics, selecting Clopath or gap-junction support only when the network requires it.
|
|
100
|
-
|
|
101
|
-
| Constructor | Use when |
|
|
102
|
-
|---|---|
|
|
103
|
-
| `sim.create(bp.hh_psc_alpha, size, params=parameters)` | Use Hodgkin-Huxley dynamics with alpha-shaped postsynaptic currents. |
|
|
104
|
-
| `sim.create(bp.hh_psc_alpha_clopath, size, params=parameters)` | Use alpha currents while exposing voltage State required by `clopath_synapse`. |
|
|
105
|
-
| `sim.create(bp.hh_psc_alpha_gap, size, params=parameters)` | Use alpha currents in a gap-junction network. |
|
|
106
|
-
| `sim.create(bp.hh_cond_exp_traub, size, params=parameters)` | Use the Traub Hodgkin-Huxley model with exponential conductances. |
|
|
107
|
-
| `sim.create(bp.hh_cond_beta_gap_traub, size, params=parameters)` | Use Traub dynamics with beta conductances and gap junctions. |
|
|
108
|
-
| `sim.create(bp.ht_neuron, size, params=parameters)` | Use the Hill-Tononi thalamocortical neuron. |
|
|
109
|
-
|
|
110
|
-
## Izhikevich neurons
|
|
111
|
-
|
|
112
|
-
Use this family when the source model explicitly requires NEST-compatible Izhikevich dynamics.
|
|
113
|
-
|
|
114
|
-
| Constructor | Use when |
|
|
115
|
-
|---|---|
|
|
116
|
-
| `sim.create(bp.izhikevich, size, params=parameters)` | Use the NEST-compatible Izhikevich neuron. |
|
|
117
|
-
|
|
118
|
-
## Point-process neurons
|
|
119
|
-
|
|
120
|
-
Use these APIs for delta point-process dynamics or the two-compartment interface required by Urbanczik-Senn learning.
|
|
121
|
-
|
|
122
|
-
| Constructor | Use when |
|
|
123
|
-
|---|---|
|
|
124
|
-
| `sim.create(bp.pp_psc_delta, size, params=parameters)` | Use a point-process neuron with leaky integration of delta-shaped currents. |
|
|
125
|
-
| `sim.create(bp.pp_cond_exp_mc_urbanczik, size, params=parameters)` | Use the two-compartment conductance model read by `urbanczik_synapse`. |
|
|
126
|
-
|
|
127
|
-
## Rate neurons
|
|
128
|
-
|
|
129
|
-
Use these APIs for vectorized rate, noisy-rate, template, or mean-field dynamics rather than spike-resolved neurons.
|
|
130
|
-
|
|
131
|
-
| Constructor | Use when |
|
|
132
|
-
|---|---|
|
|
133
|
-
| `sim.create(bp.lin_rate_ipn, size, params=parameters)` | Use a linear rate unit with input noise. |
|
|
134
|
-
| `sim.create(bp.lin_rate_opn, size, params=parameters)` | Use a linear rate unit with output noise. |
|
|
135
|
-
| `sim.create(bp.tanh_rate_ipn, size, params=parameters)` | Use a tanh rate unit with input noise. |
|
|
136
|
-
| `sim.create(bp.tanh_rate_opn, size, params=parameters)` | Use a tanh rate unit with output noise. |
|
|
137
|
-
| `sim.create(bp.sigmoid_rate_ipn, size, params=parameters)` | Use a sigmoid rate unit with input noise. |
|
|
138
|
-
| `sim.create(bp.sigmoid_rate_gg_1998_ipn, size, params=parameters)` | Use the `sigmoid_rate_gg_1998_ipn` nonlinear-rate variant with input noise. |
|
|
139
|
-
| `sim.create(bp.gauss_rate_ipn, size, params=parameters)` | Use a Gaussian rate unit with input noise. |
|
|
140
|
-
| `sim.create(bp.threshold_lin_rate_ipn, size, params=parameters)` | Use threshold-linear rate dynamics with input noise. |
|
|
141
|
-
| `sim.create(bp.threshold_lin_rate_opn, size, params=parameters)` | Use threshold-linear rate dynamics with output noise. |
|
|
142
|
-
| `sim.create(bp.rate_neuron_ipn, size, params=parameters)` | Use the input-noise rate-neuron template. |
|
|
143
|
-
| `sim.create(bp.rate_neuron_opn, size, params=parameters)` | Use the output-noise rate-neuron template. |
|
|
144
|
-
| `sim.create(bp.rate_transformer_node, size, params=parameters)` | Use the NEST-compatible rate-transformer template. |
|
|
145
|
-
| `sim.create(bp.siegert_neuron, size, params=parameters)` | Use the Siegert mean-field diffusion-rate model. |
|
|
146
|
-
|
|
147
|
-
## Binary neurons
|
|
148
|
-
|
|
149
|
-
Use these APIs for deterministic or stochastic binary-state dynamics.
|
|
150
|
-
|
|
151
|
-
| Constructor | Use when |
|
|
152
|
-
|---|---|
|
|
153
|
-
| `sim.create(bp.mcculloch_pitts_neuron, size, params=parameters)` | Use deterministic binary activation with a Heaviside gain. |
|
|
154
|
-
| `sim.create(bp.ginzburg_neuron, size, params=parameters)` | Use stochastic binary activation with a sigmoidal or affine gain. |
|
|
155
|
-
| `sim.create(bp.erfc_neuron, size, params=parameters)` | Use stochastic binary activation with a complementary error-function gain. |
|
|
156
|
-
|
|
157
|
-
## Relay and utility neurons
|
|
158
|
-
|
|
159
|
-
Use these APIs to relay spikes without transforming them or to emit fixed-interval spikes.
|
|
160
|
-
|
|
161
|
-
| Constructor | Use when |
|
|
162
|
-
|---|---|
|
|
163
|
-
| `sim.create(bp.parrot_neuron, size, params=parameters)` | Use a one-to-one spike relay, including ports that need an intermediate neuron. |
|
|
164
|
-
| `sim.create(bp.ignore_and_fire, size, params=parameters)` | Use a fixed-interval spike source. |
|
|
165
|
-
|
|
166
|
-
## Canonical construction
|
|
167
|
-
|
|
168
|
-
Use NEST parameter names with BrainUnit quantities. The same `Simulator.create()` pattern applies across all families.
|
|
169
|
-
|
|
170
|
-
```python
|
|
171
|
-
import brainunit as u
|
|
172
|
-
from brainpy import state as bp
|
|
173
|
-
|
|
174
|
-
sim = bp.Simulator(dt=0.1 * u.ms)
|
|
175
|
-
parameters = {
|
|
176
|
-
"C_m": 250.0 * u.pF,
|
|
177
|
-
"tau_m": 20.0 * u.ms,
|
|
178
|
-
"V_th": -55.0 * u.mV,
|
|
179
|
-
"I_e": 350.0 * u.pA,
|
|
180
|
-
}
|
|
181
|
-
population = sim.create(bp.iaf_psc_alpha, 100, params=parameters)
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
**Invariant:** Preserve NEST parameter names but never strip their physical units. This directory identifies the BrainPy-State API surface; use upstream NEST documentation for model physiology.
|
|
185
|
-
|
|
186
|
-
## Selection boundaries
|
|
187
|
-
|
|
188
|
-
- Choose `iaf_psc_delta`, `iaf_psc_alpha`, or `iaf_psc_exp` from the requested postsynaptic response; when the response shape is unspecified, preserve the upstream NEST model rather than guessing a substitute.
|
|
189
|
-
- Do not replace a `psc` model with a `cond` model during a port.
|
|
190
|
-
- Choose a `_ps` variant only when sub-grid spike timing matters; route its validation to event-count and spike-time parity.
|
|
191
|
-
- Choose a multisynapse variant when receptor ports or multiple time constants are part of the model; do not silently collapse channels.
|
|
192
|
-
- Use `aeif_psc_delta_clopath` or `hh_psc_alpha_clopath` with `clopath_synapse`.
|
|
193
|
-
- Use `pp_cond_exp_mc_urbanczik` with `urbanczik_synapse`.
|
|
194
|
-
- Open `references/nest-compatible/integration-categories.md` after selecting a family when numerical behavior matters.
|
|
195
|
-
- Open `references/nest-compatible/divergence-and-parity.md` before claiming parity for multi-compartment, stochastic, precise-spiking, plastic, or network-level behavior.
|
|
196
|
-
|
|
197
|
-
## Official sources
|
|
198
|
-
|
|
199
|
-
- https://brainx.chaobrain.com/brainpy-state/nest-style/models.html
|
|
200
|
-
- https://brainx.chaobrain.com/brainpy-state/apis/nest-neurons.html
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
# NEST-Compatible Workflow
|
|
2
|
-
|
|
3
|
-
## Purpose and boundary
|
|
4
|
-
|
|
5
|
-
Use this reference for the NEST-compatible `brainpy.state` path: create NEST-named neurons and devices, connect them with NEST-style rules and synapse specs, execute an explicit `Simulator`, inspect results, or port PyNEST code.
|
|
6
|
-
|
|
7
|
-
Canonical path:
|
|
8
|
-
|
|
9
|
-
`create Simulator -> create nodes and devices -> connect sources, populations, and recorders -> simulate -> read SimulationResult`
|
|
10
|
-
|
|
11
|
-
Keep this path separate from native BrainPy-State composition. Do not mix `Simulator` networks with native projection APIs such as `AlignPostProj`, `align_pre_projection`, or manual BrainState rollout loops. Open the routed NEST reference for model catalogs, plasticity, spatial networks, or parity details; use the parent BrainPy-State skill only for native models.
|
|
12
|
-
|
|
13
|
-
## Underlying principle of the NEST-compatible path
|
|
14
|
-
|
|
15
|
-
Use one explicit `Simulator` instead of PyNEST's global kernel; it owns creation, connectivity, rollout State, recording, and results. Preserve NEST names with BrainUnit quantities, while connection rules select edges, synapse specs define edge behavior, and source/observer roles determine device direction.
|
|
16
|
-
|
|
17
|
-
### API structure
|
|
18
|
-
|
|
19
|
-
| API family | Use |
|
|
20
|
-
|---|---|
|
|
21
|
-
| `brainpy.state.Simulator` | Own node creation, connection construction, simulation lifecycle, and result collection. |
|
|
22
|
-
| `brainpy.state` NEST models | Select NEST-compatible neurons, synapses, plasticity rules, generators, recorders, and detectors by NEST-style name. |
|
|
23
|
-
| `brainpy.state.network` | Inspect the underlying `Network`, `Builder`, `NodeView`, `SimulationResult`, projection, connection-rule, and `SynapseCollection` APIs. |
|
|
24
|
-
| `brainpy.state.spatial` | Place populations in 2-D or 3-D space and construct distance-dependent kernels, masks, and connection rules. |
|
|
25
|
-
| `brainunit` | Supply physical time, voltage, current, conductance, capacitance, rate, weight, and delay quantities. |
|
|
26
|
-
|
|
27
|
-
### 1. Create the simulator and nodes
|
|
28
|
-
|
|
29
|
-
Create every population and device through one `Simulator`; each `create()` call returns a `NodeView` that preserves population identity while supporting concatenation and slicing.
|
|
30
|
-
|
|
31
|
-
| API | Description |
|
|
32
|
-
|---|---|
|
|
33
|
-
| `bp.Simulator(dt=...)` | Use to start an independent NEST-compatible network; it owns the timestep, graph, rollout, and results. |
|
|
34
|
-
| `sim.create(model, size=1, *, params=None, positions=None, **kwargs)` | Use for neurons and devices; it instantiates the selected NEST-compatible model and returns a `NodeView`. Pass a large parameter set with `params=dict(...)` or individual parameters as keywords. |
|
|
35
|
-
| `left + right` | Use to concatenate `NodeView` objects while preserving their segment boundaries; the result can be passed to one `connect()` call. |
|
|
36
|
-
| `view[slice]` | Use to select a subset of a single population for connectivity or recording without creating another population. |
|
|
37
|
-
|
|
38
|
-
```python
|
|
39
|
-
import brainunit as u
|
|
40
|
-
from brainpy import state as bp
|
|
41
|
-
|
|
42
|
-
sim = bp.Simulator(dt=0.1 * u.ms)
|
|
43
|
-
neurons = sim.create(
|
|
44
|
-
bp.iaf_psc_alpha,
|
|
45
|
-
100,
|
|
46
|
-
params={"I_e": 350.0 * u.pA},
|
|
47
|
-
)
|
|
48
|
-
sample = neurons[:5]
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Open `references/nest-compatible/model-library.md` when choosing a neuron family or exact NEST-compatible model name. Open `references/nest-compatible/network-building.md` when using `Builder`, `Network`, multi-segment `NodeView` operations, or spatial placement.
|
|
52
|
-
|
|
53
|
-
### 2. Connect populations and devices
|
|
54
|
-
|
|
55
|
-
Connect source to target with a connection rule plus a unitful synapse spec, and reverse the call only for analog recorders that observe a population.
|
|
56
|
-
|
|
57
|
-
| API | Description |
|
|
58
|
-
|---|---|
|
|
59
|
-
| `sim.connect(pre, post, *, rule=..., weight=..., delay=..., ...)` | Use to build a projection, attach a source device, or register a recorder tap; it returns projection handles for realized projections and `None` for recorder taps or current injectors. |
|
|
60
|
-
| `bp.all_to_all` | Use when every source must connect to every target; this is the default generator fan-out rule. |
|
|
61
|
-
| `bp.fixed_indegree(k)` | Use when every target must draw exactly `k` presynaptic edges; set `seed` for reproducible BrainPy-State wiring and `comm="sparse"` for large event fan-in. |
|
|
62
|
-
| `synapse=bp.<synapse_model>(...)` | Use when the edge is plastic or needs behavior beyond static weight and delay; keep rule parameters on the synapse spec. |
|
|
63
|
-
| `sim.connect(generator, neuron)` | Use for current and spike sources; generators drive their targets. |
|
|
64
|
-
| `sim.connect(neuron, spike_recorder)` | Use to tap emitted spikes. |
|
|
65
|
-
| `sim.connect(multimeter, neuron)` | Use for analog observation; `multimeter` follows NEST's reversed recorder direction. |
|
|
66
|
-
|
|
67
|
-
```python
|
|
68
|
-
drive = sim.create(bp.poisson_generator, rate=8000.0 * u.Hz, rng_seed=0)
|
|
69
|
-
spike_recorder = sim.create(bp.spike_recorder)
|
|
70
|
-
meter = sim.create(
|
|
71
|
-
bp.multimeter,
|
|
72
|
-
record_from=["V_m"],
|
|
73
|
-
interval=0.1 * u.ms,
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
sim.connect(
|
|
77
|
-
drive,
|
|
78
|
-
neurons,
|
|
79
|
-
rule=bp.all_to_all,
|
|
80
|
-
weight=10.0 * u.pA,
|
|
81
|
-
delay=1.0 * u.ms,
|
|
82
|
-
)
|
|
83
|
-
sim.connect(neurons, spike_recorder)
|
|
84
|
-
sim.connect(meter, sample)
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Open `references/nest-compatible/synapse-and-connectivity.md` when selecting a static, special, STP, STDP, or voltage-based synapse; choosing a rule; or inspecting realized edges. Open `references/nest-compatible/devices.md` when selecting a generator, recorder, detector, or result-readback method.
|
|
88
|
-
|
|
89
|
-
### 3. Simulate and read results
|
|
90
|
-
|
|
91
|
-
`simulate()` starts from freshly initialized State and returns one in-memory `SimulationResult` whose common time axis indexes spike and analog recordings.
|
|
92
|
-
|
|
93
|
-
| API | Description |
|
|
94
|
-
|---|---|
|
|
95
|
-
| `sim.simulate(duration, *, dt=None)` | Use for an independent run from initialized State and time zero; it returns a `SimulationResult`. |
|
|
96
|
-
| `result.times` | Use for the run's common `(n_steps,)` time axis. |
|
|
97
|
-
| `result.spikes(recorder)` | Use for a spike recorder's `(n_steps, n_recorded)` spike matrix. |
|
|
98
|
-
| `result.rate(recorder)` | Use for the mean firing rate in spikes per second over the recorded neurons. |
|
|
99
|
-
| `result.trace(recorder, recordable)` | Use for a multimeter trace in the model State's natural unit; it raises `KeyError` when the recordable was not registered. |
|
|
100
|
-
|
|
101
|
-
```python
|
|
102
|
-
result = sim.simulate(100.0 * u.ms)
|
|
103
|
-
|
|
104
|
-
spikes = result.spikes(spike_recorder)
|
|
105
|
-
voltage = result.trace(meter, "V_m")
|
|
106
|
-
rate = result.rate(spike_recorder)
|
|
107
|
-
|
|
108
|
-
assert spikes.shape[0] == result.times.shape[0]
|
|
109
|
-
assert voltage.shape[0] == result.times.shape[0]
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Open `references/nest-compatible/network-building.md` when continuing State across windows with `cont()`, resetting persistent rollout State, recording plastic weights, inspecting `SynapseCollection`, or selecting spatial primitives.
|
|
113
|
-
|
|
114
|
-
## Reference routing
|
|
115
|
-
|
|
116
|
-
Open only the smallest reference that owns the decision.
|
|
117
|
-
|
|
118
|
-
| Reference | Open when |
|
|
119
|
-
|---|---|
|
|
120
|
-
| `references/nest-compatible/model-library.md` | Selecting or identifying a NEST-compatible neuron family or exact model name, or locating its neuron API entry |
|
|
121
|
-
| `references/nest-compatible/synapse-and-connectivity.md` | Selecting static or special synapses, STP/STDP rules, connection rules, weight/delay specs, or realized-connectivity inspection |
|
|
122
|
-
| `references/nest-compatible/devices.md` | Selecting generators, recorders, detectors, source semantics, connection direction, or result readback |
|
|
123
|
-
| `references/nest-compatible/network-building.md` | Using `Builder`, `Network`, `Simulator`, `NodeView`, `SimulationResult`, `SynapseCollection`, projection classes, connection-rule helpers, or spatial networks |
|
|
124
|
-
| `references/nest-compatible/divergence-and-parity.md` | Porting NEST code, locating STDP parameters, explaining a mismatch, choosing trace versus distributional validation, or checking documented parity bands |
|
|
125
|
-
| `references/nest-compatible/integration-categories.md` | Determining how a model family is numerically updated and which validation category to consult next |
|
|
126
|
-
|
|
127
|
-
## Full workflow scripts
|
|
128
|
-
|
|
129
|
-
Use these standalone scripts when the canonical inline workflow is too small for the task. Keep the scripts separate from the Markdown references so their complete source remains directly runnable.
|
|
130
|
-
|
|
131
|
-
| Script | Open when |
|
|
132
|
-
|---|---|
|
|
133
|
-
| `references/nest-compatible/scripts/brunel_alpha.py` | Building an alpha-synapse Brunel network |
|
|
134
|
-
| `references/nest-compatible/scripts/brunel_delta.py` | Checking delta-synapse voltage-weight semantics in a Brunel network |
|
|
135
|
-
| `references/nest-compatible/scripts/brette_et_al_2007.py` | Reproducing the comparative network workflow from Brette et al. (2007) |
|
|
136
|
-
| `references/nest-compatible/scripts/synapsecollection.py` | Inspecting or manipulating realized synapses through `SynapseCollection` |
|
|
137
|
-
| `references/nest-compatible/scripts/evaluate_tsodyks2_synapse.py` | Evaluating short-term plasticity behavior against the Tsodyks2 protocol |
|
|
138
|
-
| `references/nest-compatible/scripts/clopath_synapse_spike_pairing.py` | Running the Clopath voltage-based plasticity spike-pairing protocol |
|
|
139
|
-
| `references/nest-compatible/scripts/spatial_gaussex.py` | Building spatial connectivity with a Gaussian distance-dependent rule |
|
|
140
|
-
|
|
141
|
-
## Boundaries and common failures
|
|
142
|
-
|
|
143
|
-
- Do not mix this workflow with native BrainPy-State projections or manual rollout code; keep the whole NEST-compatible graph under one `Simulator`.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
## Official sources
|
|
147
|
-
|
|
148
|
-
- https://brainx.chaobrain.com/brainpy-state/nest-style/models.html
|
|
149
|
-
- https://brainx.chaobrain.com/brainpy-state/nest-style/connectivity.html
|
|
150
|
-
- https://brainx.chaobrain.com/brainpy-state/nest-style/devices.html
|
|
151
|
-
- https://brainx.chaobrain.com/brainpy-state/nest-style/tutorials/03-connect-network.html
|
|
152
|
-
- https://brainx.chaobrain.com/brainpy-state/apis/nest-network.html
|
|
153
|
-
- https://brainx.chaobrain.com/brainpy-state/nest-style/divergences/index.html
|
|
154
|
-
- https://brainx.chaobrain.com/brainpy-state/nest-style/validation-status.html
|
|
155
|
-
- https://brainx.chaobrain.com/brainpy-state/nest-style/divergences/stdp.html
|
|
156
|
-
- https://brainx.chaobrain.com/brainpy-state/nest-style/integration-categories.html
|