-
Notifications
You must be signed in to change notification settings - Fork 96
SSN implementation in BMTK #431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…cluded optimization notebook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for a Stabilized Supralinear Network (SSN) option in PopNet by introducing new simulation modules, integrating SSN into the PopNet API, and updating related utilities.
- Introduce
SimulatorModbase class and SSN modules (RatesRecorderMod,InitStatesMod,ExternalRatesMod) for recording rates, initializing states, and applying external inputs. - Register default SSN activation functions and expose them via the package.
- Integrate SSN target into
PopNetwork/PopSimulator, extend DIPDE compatibility, update core SONATA reader and node sets, and enhance theplot_ratesanalyzer to handle CSV/HDF5.
Reviewed Changes
Copilot reviewed 15 out of 74 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| bmtk/simulator/popnet/ssn/modules/sim_module.py | Adds SimulatorMod base class for lifecycle hooks in SSN simulations |
| bmtk/simulator/popnet/ssn/modules/rates_recorder.py | Implements RatesRecorderMod for exporting firing rates to CSV or HDF5 |
| bmtk/simulator/popnet/ssn/modules/initial_states.py | Implements InitStatesMod with multiple initialization backends (CSV, function) |
| bmtk/simulator/popnet/ssn/modules/external_inputs.py | Implements ExternalRatesMod for loading external input streams |
| bmtk/simulator/popnet/ssn/default_setters/activation_functions.py | Registers a default ReLU (relu2) activation function via add_activation_function |
| bmtk/simulator/popnet/ssn/init.py | Exports SSN entry points (PopNetwork, PopSimulator, function caches) |
| bmtk/simulator/popnet/dipde/popsimulator.py | Adds from_json helper and imports SimulationConfig for DIPDE simulator |
| bmtk/simulator/popnet/dipde/popnetwork.py | Adds target_simulator property and fixes import paths for DIPDE |
| bmtk/simulator/core/sonata_reader/node_adaptor.py | Extends model_type handling to include 'rate_population' |
| bmtk/simulator/core/node_sets.py | Implements __len__ for NodeSet |
| bmtk/analyzer/firing_rates.py | Adds a new plot_rates function supporting CSV and HDF5 rate files |
Comments suppressed due to low confidence (2)
bmtk/simulator/popnet/ssn/modules/initial_states.py:103
- [nitpick] The exception message 'AAAA' is not descriptive. Provide a clear message explaining the unsupported distribution type.
raise Exception("AAAA")
bmtk/simulator/popnet/ssn/modules/initial_states.py:29
self.__name__is undefined on instances; useself.__class__.__name__(or similar) to reference the class name in the error message.
raise ValueError(f'{self.__name__}: Error in {self._name} input module, no valid module [options: csv, constant, random, function]')
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
A new PopNet option based on Stabilized Supralinear Network.
Simulating 4 population will be 0.2ms per simulated second.
A network simulation example as well as parameter optimization tutorial notebook is provided.