Skip to main content

A framework for spiking neural network modeling.

Project description

Sapicore

A PyTorch-Based Spiking Neural Network Simulation Framework

Sapicore is a spiking neural network (SNN) simulator, built with PyTorch and designed for neuroscience-inspired models with realistic architectures and dynamics.

We provide a simple API for:

  • Data loading and transformation.
  • Initializing and connecting network components.
  • Extending base neurons (e.g., LIF) and synapses (e.g., STDP).
  • Orchestrating experiment pipelines.
  • Selectively logging intermediate results.
  • Deploying neuromorphic networks as machine learning models.
  • Visualizing, interpreting, and analyzing output.

Users may configure networks in YAML or directly in code. Develop custom neuron, synapse, network, and data loader classes.

We made component extension and customization easy. Default implementations of common models used in computational neuroscience and neuromorphic machine learning applications are provided out of the box.

Sapicore interfaces with industry-standard ML libraries, including scikit-learn.

A project of the Computational Physiology Lab @ Cornell University.


Current Release

Sapicore 0.4 is runtime- and memory-optimized. This beta version includes:

  • Flexible data classes (metadata-based row selection).
  • Spiking neurons (LIF and IZ).
  • Graded neurons (integrators, oscillators).
  • Static and plastic synapses (STDP).
  • Automated network construction and simulation.
  • Scikit-integrated ML model API (fit/predict).
  • Sampling and cross validation tools.
  • Visualization tools.

To simulate a network from a YAML configuration using the default simulation pipeline:

python simple.py -config /path/to/config_file.yaml

See tutorials and tests/engine/network/test_network for instructive scripts and YAML files.


Installation

Basic requirements include Python 3.11+, PyTorch 2.1+, NetworkX, and the scientific stack (numpy, scipy, pandas).

To install the most recent development version:

pip install https://github.com/cplab/sapicore/archive/refs/heads/main.zip

To run tests, change directory to the one containing pytest.ini (sapicore) and call:

pytest -v -s

To run tests with a coverage report, run sapicore/tests/scripts/run_tests.py. The coverage report will be generated in a separate directory on the same level (open index.html).


Development

If you would like to modify or extend this library:

  • Clone the repository:

    git clone https://github.com/cplab/sapicore.git
    
  • Create a conda virtual environment (optional):

    conda create -n <env_name> python=3.11
    conda activate <env_name>
    
  • Change directory to sapicore and install with pip:

    cd sapicore
    pip install -e .
    

This project uses black to format code and flake8 for linting. We support pre-commit. To configure your local environment, install these development dependencies and set up the commit hooks:

pip install black flake8 pre-commit
pre-commit install

Documentation can be compiled by installing Sphinx and RTD, then running docs/refresh.sh. See setup.py for more information.

Citation

If you use Sapicore, please cite it as:

References

For more information about past and ongoing projects utilizing Sapicore, refer to the following publications:

For a dynamical systems perspective on neural computation, temporal coding, and top-down control of sensory processing, the following article may be of interest:

Contributors

Roy Moyal, Matthew Einhorn, Ayon Borthakur, Thomas Cleland.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sapicore-0.4.1.tar.gz (76.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sapicore-0.4.1-py2.py3-none-any.whl (95.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sapicore-0.4.1.tar.gz.

File metadata

  • Download URL: sapicore-0.4.1.tar.gz
  • Upload date:
  • Size: 76.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for sapicore-0.4.1.tar.gz
Algorithm Hash digest
SHA256 ac5cb5128bd4bcde7e2ca41d5ef36cff8b0bb7a5e9e8d62a07916ee66afab275
MD5 5004e673ef5557d68773bad677d4dcd6
BLAKE2b-256 ce979479ca7508e0f034d75e005f43303a284788bfe08cf8764e5224d6057e2c

See more details on using hashes here.

File details

Details for the file sapicore-0.4.1-py2.py3-none-any.whl.

File metadata

  • Download URL: sapicore-0.4.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 95.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for sapicore-0.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 64f0fe175abbe67cf4e9c3f3734fc0a3cf6c71db3d2c85fdc61b15ccbef4676e
MD5 81988417e56c1bfb9f39bef3455411b6
BLAKE2b-256 80fbf6e98dab1a51a0319b45bda9547a264e0282172b7523ac01d74a28b68f52

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page