Spikeometric: Linear Non-Linear Cascade Spiking Neural Networks with Pytorch Geometric

Jakob L. Sønstebø, Herman Brunborg, Mikkel Elle LepperødJ. Open Source Softw 2023 · DBLP

Abstract

spikeometric is a Python package built on PyTorch Geometric designed for simulating spiking neural networks using linear non-linear cascade models, such as Generalized Linear Models (GLMs). By providing a fast, GPU-accelerated, and auto-differentiable framework for stochastic point-process models, spikeometric bridges the gap between traditional biological simulators and modern deep learning frameworks. It facilitates the generation of synthetic data for inverse problems and the fitting of complex neural encoding models.

Introduction

In computational neuroscience, stochastic point-process models—including the Linear-Nonlinear-Poisson (LNP) model and the Generalized Linear Model (GLM)—are fundamental for characterizing neural responses. These "linear non-linear cascade" models simplify complex subcellular biology by representing a neuron's output as a sequence: environmental input is mapped to a firing rate via a nonlinear function, which then serves as a parameter for a probability distribution from which discrete spikes are sampled.

Despite their importance for mapping neural activity to connectivity, existing tools often fall short. Traditional simulators like NEST, NEURON, or Brian2 are primarily optimized for solving differential equations in hard-threshold models and offer limited, CPU-bound support for stochastic processes. Conversely, modern deep learning frameworks like snnTorch or BindsNET focus on machine learning tasks and are typically restricted to Leaky Integrate-and-Fire (LIF) models. spikeometric addresses this need by offering a unified framework specifically for linear non-linear cascade models.

Methodology

spikeometric leverages PyTorch Geometric (PyG) to provide a flexible and high-performance simulation environment.

Graph-Based Representation

The framework represents neural networks as graphs, where neurons are vertices and synapses are edges. By extending PyG’s MessagePassing base class, biological models are implemented as torch_geometric Data objects. This abstraction allows for the seamless integration of complex network topologies.

GPU Acceleration and Autodiff

Built on a PyTorch backend, the simulator natively supports GPU acceleration for large-scale networks. Crucially, it utilizes PyTorch’s automatic differentiation. As long as the model's nonlinearity is differentiable, researchers can automatically optimize arbitrary parameters—such as synaptic weights—to match specific target firing rates or experimental observations.

Parallel Simulation

spikeometric utilizes sparse representations for connectivity matrices, enabling multiple distinct neural networks to be batched together as isolated subgraphs within a single large graph. This approach allows for massive parallelization, enabling the simultaneous simulation of many networks.

Key Insights

  • GNNs as a Natural Abstraction: Formulating biological neural networks as graphs within a GNN library provides a highly efficient and intuitive framework for simulation.
  • Seamless Model Fitting: Integrating traditional neuroscience models into the PyTorch ecosystem enables "free" parameter tuning via autodiff, significantly simplifying the process of fitting encoding models to spike data.
  • Scalable Batching: By treating separate networks as disconnected subgraphs, spikeometric leverages deep learning batching techniques to achieve high-throughput simulation.

Conclusion

spikeometric serves as a powerful tool for generating data for inverse problems, such as reconstructing causal connectivity from neural activity. Its flexible design provides a foundation for implementing more complex neural encoding models. While currently focused on stochastic point-processes, the framework's architecture is well-suited for future expansions into more detailed biological simulations.

Summary updated

BibTeX
@article{snsteb2023spikeometric,
  author = {Jakob L. Sønstebø and Herman Brunborg and Mikkel Elle Lepperød},
  title = {{Spikeometric: Linear Non-Linear Cascade Spiking Neural Networks with Pytorch Geometric}},
  journal = {J. Open Source Softw.},
  year = {2023},
  doi = {10.21105/joss.05451},
}
Figure