axon_sdk.networks.functional package

Submodules

axon_sdk.networks.functional.adder module

class axon_sdk.networks.functional.adder.AdderNetwork(encoder: DataEncoder, module_name: str | None = None)[source]

Bases: LinearCombinatorNetwork

Wrapper around the linear combinator that performs signed 2-addition: out = x1 + x2

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

axon_sdk.networks.functional.divider module

class axon_sdk.networks.functional.divider.DivNetwork(encoder: DataEncoder, module_name: str | None = None)[source]

Bases: SpikingNetworkModule

DivNetworkModule: Given inputs x1 and x2 between [0, 1] such that x1 <= x2, it computes x1 / x2. Experiments show 4 decimal places of precision.

> IMPORTANT: It’s the user responsability to guarantee that x1 <= x2. Otherwise, The network will malfunction (it will not output any spikes)

Its working principle is based on the identity x1/x2 = exp(ln(x1) - ln(x2)).

It uses two log modules whose outputs are synced, a sub network to generate the difference and a exp network to compute back the exponent.

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

class axon_sdk.networks.functional.divider.LogAndSyncNetwork(encoder: DataEncoder, module_name: str | None = None)[source]

Bases: SpikingNetworkModule

> IMPORTANT: Do not use this network outside of this file since it’s tailor made for the div module.

Inspired by the log network and multiplier network (discussed in the STICK paper), it computes the log of both inputs and outputs them synced in time.

For each of its inputs (x1 and x2, in [0,1]), the output is a pair of spikes with a time interval of Tmin + tf * (-ln(xi))

(Note ln(xi) < 0)

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

axon_sdk.networks.functional.exponential module

class axon_sdk.networks.functional.exponential.ExponentialNetwork(encoder: DataEncoder, module_name: str | None = None)[source]

Bases: SpikingNetworkModule

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

axon_sdk.networks.functional.exponential.decode_exponential(output_interval, encoder: DataEncoder, tf)[source]
axon_sdk.networks.functional.exponential.expected_exp_output_delay(x, encoder: DataEncoder, tf)[source]

axon_sdk.networks.functional.integrator module

class axon_sdk.networks.functional.integrator.IntegratorNetwork(encoder: DataEncoder, constant: float, coeffs: list, prefix: str = '')[source]

Bases: SpikingNetworkModule

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

axon_sdk.networks.functional.linear_combinator module

class axon_sdk.networks.functional.linear_combinator.LinearCombinatorNetwork(encoder: DataEncoder, N: int, coeff: list[float], module_name: str | None = None)[source]

Bases: SpikingNetworkModule

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

axon_sdk.networks.functional.linear_combinator.decode_spike_interval(spikes, encoder)[source]

axon_sdk.networks.functional.multiplier module

class axon_sdk.networks.functional.multiplier.MultiplierNetwork(encoder: DataEncoder, module_name: str | None = None)[source]

Bases: SpikingNetworkModule

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

axon_sdk.networks.functional.natural_log module

class axon_sdk.networks.functional.natural_log.LogNetwork(encoder: DataEncoder, module_name: str | None = None)[source]

Bases: SpikingNetworkModule

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

axon_sdk.networks.functional.natural_log.decode_logarithm(output_interval, encoder: DataEncoder, tf: float)[source]
axon_sdk.networks.functional.natural_log.expected_log_output_delay(x, encoder: DataEncoder, tf: float)[source]

axon_sdk.networks.functional.scalar_multiplier module

class axon_sdk.networks.functional.scalar_multiplier.ScalarMultiplierNetwork(factor: float, encoder: DataEncoder, module_name: str | None = None)[source]

Bases: SpikingNetworkModule

Rescales a STICK-coded value by multiplying it by factor: output interval = input interval x factor If interval x scale is bigger than 1.0, subsequent encoded values are meaningless.

> IMPORTANT: it’s the user’s responsability to guarantee that interval x factor is smaller than 1.0 for all possible input intervals.

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

axon_sdk.networks.functional.signed_multipler_norm module

class axon_sdk.networks.functional.signed_multipler_norm.SignedMultiplierNormNetwork(encoder: DataEncoder, factor: float, module_name: str | None = None)[source]

Bases: SpikingNetworkModule

Module composed of a signed multiplier followed by a scalar multiplier.

Given two input values x1 and x2 in the range [0,1] and a factor in the range [0,100], the output is:

output = (x1 * x2) * factor

> IMPORTANT: It’s the user’s responsability to guarantee that (x1 * x2) * factor < 1. Otherwise, the network will misbehave due to the overflow.

This block is useful to perform multiplication over an extended range of inputs beyond [0,1]. For example, to multiply 13 and 7 the block can be used as follows:

x1 = 13 / 100 x2 = 7 / 100 factor = 100

output = (13 * 7) / 100

Denormalizing the output by multiplying by 100 will yield a result in the original range

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

axon_sdk.networks.functional.signed_multiplier module

class axon_sdk.networks.functional.signed_multiplier.SignedMultiplierNetwork(encoder: DataEncoder, module_name: str | None = None)[source]

Bases: SpikingNetworkModule

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

axon_sdk.networks.functional.signflip module

class axon_sdk.networks.functional.signflip.SignFlipperNetwork(encoder: DataEncoder, module_name: str | None = None)[source]

Bases: SpikingNetworkModule

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

axon_sdk.networks.functional.subtractor module

class axon_sdk.networks.functional.subtractor.SubtractorNetwork(encoder: DataEncoder, module_name=None)[source]

Bases: SpikingNetworkModule

add_neuron(Vt: float, tm: float, tf: float, Vreset: float = 0.0, neuron_name: str | None = None) ExplicitNeuron

Create and add a neuron to this module.

Parameters:
  • Vt (float) – Threshold voltage.

  • tm (float) – Membrane time constant.

  • tf (float) – Synaptic decay time constant.

  • Vreset (float, optional) – Reset voltage after spike. Defaults to 0.0.

  • neuron_name (str, optional) – Optional name for this neuron.

Returns:

The newly created neuron.

Return type:

ExplicitNeuron

add_subnetwork(subnet: SpikingNetworkModule) None

Add a nested spiking network module.

Parameters:

subnet (SpikingNetworkModule) – The submodule to add.

connect_neurons(pre_neuron: ExplicitNeuron, post_neuron: ExplicitNeuron, synapse_type: str, weight: float, delay: float)

Connect two neurons via a synapse.

Parameters:
  • pre_neuron (ExplicitNeuron) – Presynaptic neuron.

  • post_neuron (ExplicitNeuron) – Postsynaptic neuron.

  • synapse_type (str) – Type of synapse (‘V’, ‘ge’, ‘gf’, ‘gate’, etc.).

  • weight (float) – Synaptic weight.

  • delay (float) – Synaptic delay in seconds.

property instance_count: int

Returns: int: Instance index assigned at construction.

property neurons: list[ExplicitNeuron]

Recursively collect all neurons from this module and its submodules.

Returns:

List of all neurons in the hierarchy.

Return type:

list[ExplicitNeuron]

property neurons_with_module_uid: dict[ExplicitNeuron, str]

Get a mapping from all neurons in the hierarchy to their parent module UID.

Returns:

Mapping from neuron to module UID.

Return type:

dict[ExplicitNeuron, str]

recurse_neurons_with_module_uid() list[dict[ExplicitNeuron, str]]

Recursively build a list of dictionaries mapping each neuron to its module UID.

Returns:

One dictionary per neuron/module pair.

Return type:

list[dict[ExplicitNeuron, str]]

property subnetworks: list[Self]

Returns: list[SpikingNetworkModule]: Submodules contained in this module.

property top_module_neurons: list[ExplicitNeuron]

Returns neurons belonging to current module, without taking submodules into account

property uid: str

Returns: str: Unique identifier of this module.

Module contents