Skip to main content

⚡ Spark: Modular Spiking Neural Networks

Spark Logo

Build, train, and deploy state-of-the-art Spiking Neural Networks with a powerful visual interface and JAX.

Build Status License GitHub Stars PyPI version

Spark is a next-generation framework designed to simplify and accelerate the research, development, and deployment of non-gradient-base Spiking Neural Networks (SNNs). Our goal is to make SNNs more accessible to researchers, engineers, and enthusiasts by abstracting away boilerplate code and providing intuitive tools for model creation and experimentation, while maintaing state-of-the-art performance.

Key Features (Philosophy?)

⚡ High-Performance Backend: Powered by JAX and Flax NNX, Spark enables just-in-time (JIT) compilation and state management of entire models.

🧩 Modular & Extensible: Modular by construction. Everything (that is worth interacting) in Spark is a self-contained module. Easily create, modify, and share custom neuron models, synapses, and plasticity rules. Ever wanted a neuron with 3 Somas, 2 sets of Synapses and 2.5 Plasticity rules? As long as it can spike, you came to the right place!

🔄 Seamless Workflow: Spiking neural networks are not special, why should they require special data?!. One of the core features of Spark is the concept of input and output interfaces which are simple modules that help you transform regular datasets into streams of spikes and transform streams of spikes back into boring data formats like floats.

🧠 Graph Editor: Design complex SNN architectures by dragging, dropping, and connecting pre-built neural components. No coding required for model design.

📊 Built-in Visualization: Tools for recording and visualizing spike trains, membrane potentials, network activity and much more (also available in real-time!).

Getting Started

Spark is available on PyPI, so it can be installed with:

Lightweight version,

pip install spark-snn

Full version,

pip install spark-snn[editor]

Or, for the latest development version, clone this repository:

git clone https://github.com/nogarx/spark.git
cd spark
pip install -e .

Do not know what to do next? The tutorials are here to help you!

The Spark Graph Editor

Design your network's structure, set parameters for each component, and connect them to create a model.

Spark Graph Editor

The Spark visual interface for building SNNs.

You can start the Graph Editor through the CLI,

editor = spark.GraphEditor()
editor.launch()

or inside a Notebook!

%gui qt
editor = spark.GraphEditor()
if __name__ == "__main__":
    editor.launch()

Afterwards you can simply export your model and build it.

import spark

# Initialize the configuration class
brain_config = spark.nn.BrainConfig.from_file('./my_awesome_model.scfg')

# Construct the brain.
brain = spark.nn.Brain(config=brain_config)

# Build the brain.
brain(**my_awesome_inputs)

To harvest the true power of Spark your model needs to be JIT compiled. Jax requires your model to be traceable, which sometimes can be quite unintutive. Fortunately, this is quite simple in Spark, and most of the time it will look very similar to the next function.

import jax

@jax.jit
def run_model(graph, state, **my_awesome_inputs):
    # Reconstruct model
	model = spark.merge(graph, state)
    # Compute
	out = model(**my_awesome_inputs)
    # Split the model and recover its state.
    _, state = spark.split((model))
	return out, state

Finally, do the initial split of the model and use your function.

import jax.numpy as jnp

# Some dummy data
my_awesome_inputs = {
    x_0 = jnp.ones((64,), dtype=jnp.float16)
    ...
    x_k = jnp.ones((128,), dtype=jnp.float16)
}

# Split the model
graph, state = spark.split((model))

# Use run_model and reuse state!
out, state = run_model(graph, state, **my_awesome_inputs)

# State now contains the updated state of the model!.

There is much more to Spark that what we can show here, if you are ready to learn more you can go to the tutorial section!

Roadmap

We have many exciting features planned.

🔥 Components, a lot of them: Spark is built around the idea of modular neurons. Literature is full of really interesting ideas but integrating them to existing code is sometimes annoying and prone to errors. One of our goals is to transform those ideas into modular, reusable and plugable code.

🧮 Custom kernels: Spark is fast but it can be faster!. Several operations can be further optimized using custom kernels.

Contributing

Contributions are what make the open-source community such an amazing place. Any contributions you make are greatly appreciated. Want to contribute but you do not know where to start? The discussion forum! may be the place you are looking for!.

Citing Spark

You can use the following reference to cite this repository,

@software{spark_snn_github,
  author = {Mario Franco, Carlos Gershenson},
  title = {Spark: Modular Spiking Neural Networks},
  url = {https://github.com/nogarx/spark/},
  version = {0.1.0},
  year = {2025},
}

Metadata

Release files for spark-snn 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spark-snn 1.2.1
File Size Uploaded
spark_snn-1.2.1.tar.gz 6.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for spark-snn 1.2.1
File Interpreter ABI Platform
spark_snn-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.2 MB

Release files / spark_snn-1.2.1.tar.gz

Download URL spark_snn-1.2.1.tar.gz
Size 6.6 MB
Tags Source
SHA-256 checksum
How to use checksums
1e286f509c7febd235af7b21f512a2a1706c25f314e71a3fe0a723bbb2711b5c
BLAKE2b-256 checksum
How to use checksums
a58772682e9d1774f51961ba41fc74c3a91ff17ee66266da3c4aa9884970a66f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / spark_snn-1.2.1-py3-none-any.whl

Download URL spark_snn-1.2.1-py3-none-any.whl
Size 556.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9db27b3b0b31d795a4cabf669f491fd963564ad68520a835b8f6c248aab2b60b
BLAKE2b-256 checksum
How to use checksums
e917f28511ad01973ee36ea18a3731460157ea910da6b579a83a4213e4bc1eb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

1.2.2

2 release files

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page