Skip to content

Conversation

@932179209
Copy link
Collaborator

No description provided.

chaoming0625 and others added 3 commits October 11, 2025 18:34
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 updates
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @932179209, your pull request is larger than the review limit of 150000 diff characters

@github-actions
Copy link
Contributor

🎉 Congratulations on opening your first pull request in BrainPy! Thank you for your contribution!

A maintainer will review your changes soon. Please make sure:

  • ✅ Your code follows our style guidelines
  • ✅ All tests pass
  • ✅ Documentation is updated (if applicable)
  • ✅ You've filled out the PR template completely

We appreciate your effort in making BrainPy better. If you have any questions, feel free to ask in the comments.

Welcome to the BrainPy community! 🌟

@github-actions github-actions bot added the tests label Oct 13, 2025
@932179209 932179209 changed the title update state neuron and synapese update state neuron and synapse Oct 13, 2025
Added comprehensive Examples sections to 5 neuron classes that were
missing them:
- QuaIF: Quadratic Integrate-and-Fire neuron
- AdQuaIF: Adaptive Quadratic Integrate-and-Fire neuron
- AdQuaIFRef: AdQuaIF with refractory period
- Gif: Generalized Integrate-and-Fire neuron
- GifRef: Gif with refractory period

Each Examples section includes:
- Import statements for required modules
- Basic usage with parameter specifications
- State initialization examples
- Update and spike generation examples
- Network integration with brainstate.nn.Sequential
- Additional Notes highlighting key features

All 13 neuron classes in _lif.py now have complete documentation
with Examples sections following consistent format and style.
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 13, 2025
@chaoming0625 chaoming0625 merged commit dfb6a69 into master Oct 13, 2025
17 checks passed
@chaoming0625 chaoming0625 deleted the update branch October 13, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants