axon_sdk package

Subpackages

Submodules

axon_sdk.simulator module

Simulator

This module defines the main Simulator class for executing spiking neural networks built with the STICK model. It provides methods for input application, event propagation, spike/voltage logging, and value decoding.

Key components: - Simulator: core class for managing simulation execution. - decode_output: utility to read a signed value from STICK output neurons. - count_spikes: utility to count total emitted spikes in a simulation.

The simulator works in discrete time with configurable timestep dt, executing all synaptic and neuron dynamics via event-based updates and logging internal state.

class axon_sdk.simulator.Simulator(net: SpikingNetworkModule, encoder: DataEncoder, dt: float = 0.001)[source]

Bases: object

Core simulation engine for executing STICK spiking neural networks.

net

The spiking neural network to simulate.

Type:

SpikingNetworkModule

encoder

Object for converting values to spike intervals and back.

Type:

DataEncoder

dt

Simulation time resolution in seconds.

Type:

float

spike_log

Records spike times per neuron UID.

Type:

dict[str, list[float]]

voltage_log

Records membrane voltages over time.

Type:

dict[str, list[tuple]]

event_queue

Queue of scheduled synaptic events.

Type:

SpikeEventQueue

apply_input_spike(neuron: ExplicitNeuron, t: float)[source]

Apply a single spike input to a neuron at a specified time.

Parameters:
  • neuron (ExplicitNeuron) – Target neuron to spike.

  • t (float) – Time at which spike occurs.

apply_input_value(value: float, neuron: ExplicitNeuron, t0: float = 0)[source]

Apply a normalized value as spike interval input to a given neuron.

Parameters:
  • value (float) – Value in [0, 1] to encode and inject.

  • neuron (ExplicitNeuron) – Target neuron for injection.

  • t0 (float, optional) – Time offset for input spike injection. Defaults to 0.

classmethod init_with_plan(plan: ExecutionPlan, encoder: DataEncoder, dt: float = 0.001) Self[source]

Construct a simulator using an execution plan.

Parameters:
  • plan (ExecutionPlan) – Precompiled network with input triggers.

  • encoder (DataEncoder) – Encoder used to encode input values.

  • dt (float, optional) – Timestep in seconds. Defaults to 0.001.

Returns:

Initialized simulator instance.

Return type:

Simulator

launch_visualization()[source]

Launch interactive topology and chronogram visualizations of the simulation.

Requires VIS=1 in environment variables.

simulate(simulation_time: float)[source]

Run the network simulation for a given total duration.

Parameters:

simulation_time (float) – Total simulation duration in seconds.

Logs:
  • Spike times in self.spike_log

  • Voltage traces in self.voltage_log

axon_sdk.simulator.count_spikes(sim: Simulator) int[source]

Count the total number of spikes emitted by all neurons in a simulation.

Parameters:

sim (Simulator) – Simulator instance.

Returns:

Total number of spikes across all neurons.

Return type:

int

axon_sdk.simulator.decode_output(sim: Simulator, reader: OutputReader) float | None[source]

Decode the final signed output value from two STICK neurons after simulation.

Parameters:
  • sim (Simulator) – Simulator instance with spike log.

  • reader (OutputReader) – Decoder object with read neuron handles and normalization.

Returns:

The decoded signed value, or None if no output was produced.

Return type:

Optional[float]

Raises:

ValueError – If more than 2 spikes or invalid combinations are detected.

Module contents

Axon SDK

Axon is a Python-based simulation toolkit for spike-timing-based computation using the STICK (Spike Timing Interval Computational Kernel) model.

It provides: - Primitives for defining STICK neurons and synapses. - Tools for composing symbolic spiking networks. - Compilation routines to map symbolic models to executable primitives. - A simulator for event-driven execution and visualization of spike dynamics.

This SDK is part of the Neucom platform developed by Neucom ApS.