Commit a45684d
committed
Add state version implementations for neuron and synapse models
This commit implements state versions of several neuron and synapse models
using the brainstate framework, following BrainPy v2.7+ architecture.
Neuron Models Added:
- LIF (Leaky Integrate-and-Fire) neurons with multiple variants:
* LIF: Basic LIF neuron with exponential synaptic input
* LifRef: LIF with refractory period
* ExpIF: Exponential Integrate-and-Fire
* ExpIFRef: ExpIF with refractory period
* AdExIF: Adaptive Exponential Integrate-and-Fire
* AdExIFRef: AdExIF with refractory period
* QuaIF: Quadratic Integrate-and-Fire
* QuaIFRef: QuaIF with refractory period
* AdQuaIF: Adaptive Quadratic Integrate-and-Fire
* AdQuaIFRef: AdQuaIF with refractory period
* GifRef: Generalized Integrate-and-Fire with refractory
- Izhikevich neuron model with variants:
* Izhikevich: Basic Izhikevich neuron
* IzhikevichRef: With refractory period
- Hodgkin-Huxley (HH) neuron model:
* HH: Classic Hodgkin-Huxley model with Na+ and K+ channels
Synapse Models Added:
- BioNMDA: Biological NMDA receptor with second-order kinetics
* Implements two-state cascade dynamics (x and g variables)
* Slower rise time compared to AMPA (biologically realistic)
* Comprehensive documentation with mathematical formulation
Testing:
- Comprehensive test suites added for all models
- AMPA and GABAa synapse tests added
- All tests passing with proper unit handling
Key Features:
- Uses brainstate ecosystem (HiddenState, ShortTermState, LongTermState)
- Proper unit support with brainunit
- Exponential Euler integration for numerical stability
- Batch processing support
- Consistent API design across all models
Files Modified:
- brainpy/state/_lif.py: Added LIF variants
- brainpy/state/_izhikevich.py: Added Izhikevich variants (new file)
- brainpy/state/_hh.py: Added HH model (new file)
- brainpy/state/_synapse.py: Added BioNMDA model
- brainpy/state/_synapse_test.py: Added comprehensive tests
- brainpy/state/_lif_test.py: Added LIF tests
- brainpy/state/__init__.py: Updated exports
- brainpy/dyn/neurons/lif.py: Minor documentation updates1 parent 3448676 commit a45684d
10 files changed
Lines changed: 3924 additions & 203 deletions
File tree
- brainpy
- dyn/neurons
- state
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
857 | 857 | | |
858 | 858 | | |
859 | 859 | | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
860 | 864 | | |
861 | 865 | | |
862 | 866 | | |
| |||
978 | 982 | | |
979 | 983 | | |
980 | 984 | | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
981 | 989 | | |
982 | 990 | | |
983 | 991 | | |
| |||
1319 | 1327 | | |
1320 | 1328 | | |
1321 | 1329 | | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
1322 | 1334 | | |
1323 | 1335 | | |
1324 | 1336 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
39 | | - | |
| 43 | + | |
40 | 44 | | |
41 | | - | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
0 commit comments