superneuromat.SNN.create_neuron#

SNN.create_neuron(threshold: float = 0.0, leak: float = inf, reset_state: float = 0.0, refractory_period: int = 0, refractory_state: int = 0, initial_state: float | None = 0.0) Neuron[source]#

Create a neuron in the SNN.

Parameters:
  • threshold (float, default=0.0) – Neuron threshold; the neuron spikes if its internal state is strictly greater than the neuron threshold

  • leak (float, default=numpy.inf) – Neuron leak; the amount by which the internal state of the neuron is pushed towards its reset state

  • reset_state (float, default=0.0) – Reset state of the neuron; the value assigned to the internal state of the neuron after spiking

  • refractory_period (int, default=0) – Refractory period of the neuron; the number of time steps for which the neuron remains in a dormant state after spiking

Returns:

The Neuron object.

Return type:

Neuron

Raises:
  • TypeError – If threshold, leak, or reset_state is not a float or int, or if refractory_period is not an int.

  • ValueError – If leak is less than 0.0 or refractory_period is less than 0.

Hint

Neuron.idx is the ID of the created neuron.