Simulator engine

The Axon SDK simulates Spiking Neural Networks (SNNs) built with the STICK framework. This document describes the simulation engine’s architecture, parameters, workflow, and features.


Purpose

The Simulator class provides a discrete-time, event-driven environment to simulate:

  • Spiking neuron dynamics
  • Synaptic event propagation
  • Interval-based input encoding and output decoding
  • Internal logging of voltages and spikes

It is optimized for symbolic, low-rate temporal computation rather than high-frequency biological modeling.

from axon_sdk.simulator import Simulator

Core Components

The Simulator wraps a SNN, defined as an SpikingNetworkModule, inputs spikes to it and simulates its dynamics.

class Simulator:
    def __init__(self, net: SpikingNetworkModule, encoder: DataEncoder, dt: float = 0.001):
      ...

These are the components needed to instantiate a new simulator:

ComponentDescription
netThe user-defined spiking network (a SpikingNetworkModule)
encoderObject for encoding/decoding interval-coded values
dtSimulation timestep in seconds (default: 0.001)

Calling .simulate(simulation_time) executes the simulation.

Note: It’s the user’s responsability to set an appropriate simulation_time that allows the SNN to finalize its dynamic evolution.

Simulation logs

The simulator logs relevant information during the simulation, which can be retrieved once it’s finished:

PropertyDescription
.spike_logDictionary mapping neurons to the timing of their emitted spikes
.voltage_logDictionary mapping neurons to the evolution of their membrane potentials

Input injection

The Simulator is responsible for inputting values to the SNN:

PropertyDescription
.apply_input_value(value, neuron, t0)Encodes a value and inputs their corresponding spikes
.apply_input_spike(neuron, t)Inputs an individual spike

Visualization

Axon provides visualization tools for debugging purposes:

  • Network topology visualization
  • Chronogram

These visualizations are shown once the simulation is done.

To enable the visualization tools, the environment variable VIS must be set

Environment VariableDescription
VIS=1Opens visualization after simulation

Usage example:

VIS=1 python mul_network.py

Multiplier network topology

Multiplier chronogram

Example usage

from axon_sdk.simulator import Simulator
from axon_sdk.networks import MultiplierNetwork
from axon_sdk.primitives import DataEncoder

encoder = DataEncoder()
net = MultiplierNetwork(encoder)
sim = Simulator(net, encoder, dt=0.001)

a, b = 0.4, 0.25
sim.apply_input_value(a, net.input1, t0=0)
sim.apply_input_value(b, net.input2, t0=0)
sim.simulate(simulation_time=400)

spikes = sim.spike_log.get(net.output.uid, [])
interval = spikes[1] - spikes[0]
decoded_val = encoder.decode_interval(interval)
decoded_val
>> 0.1

Summary

  • Event-driven, millisecond-resolution simulator
  • Supports interval-coded STICK networks
  • Accurate logging of all internal neuron dynamics
  • Integrates seamlessly with compiler/runtime interfaces