spynnaker.pyNN.models.neuron.implementations package

Module contents

class spynnaker.pyNN.models.neuron.implementations.AbstractNeuronImpl

Bases: object

An abstraction of a whole neuron model including all parts.

abstractmethod add_parameters(parameters: RangeDictionary) None[source]

Add the initial values of the parameters to the parameter holder.

Parameters:

parameters (RangeDictionary) – A holder of the parameters

abstractmethod add_state_variables(state_variables: RangeDictionary) None[source]

Add the initial values of the state variables to the state variables holder.

Parameters:

state_variables (RangeDictionary) – A holder of the state variables

abstract property binary_name: str

The name of the binary executable of this implementation.

Return type:

str

abstractmethod get_global_weight_scale() float[source]

Get the weight scaling required by this model.

Return type:

float

abstractmethod get_n_synapse_types() int[source]

Get the number of synapse types supported by the model.

Return type:

int

abstractmethod get_recordable_data_types() Mapping[str, DataType][source]

Get the data type of the variables that can be recorded.

Returns:

dictionary of name of variable to data type of variable

Return type:

dict(str,DataType)

abstractmethod get_recordable_units(variable: str) str[source]

Get the units of the given variable that can be recorded.

Parameters:

variable (str) – The name of the variable

abstractmethod get_recordable_variable_index(variable: str) int[source]

Get the index of the variable in the list of variables that can be recorded.

Parameters:

variable (str) – The name of the variable

Return type:

int

abstractmethod get_recordable_variables() Sequence[str][source]

Get the names of the variables that can be recorded in this model.

Return type:

list(str)

abstractmethod get_synapse_id_by_target(target: str) int | None[source]

Get the ID of a synapse given the name.

Parameters:

target (str) – The name of the synapse

Return type:

int

abstractmethod get_synapse_targets() Sequence[str][source]

Get the target names of the synapse type.

Return type:

list(str)

abstractmethod get_units(variable: str) str[source]

Get the units of the given variable.

Parameters:

variable (str) – The name of the variable

Return type:

str

abstract property is_conductance_based: bool

Whether the model uses conductance.

Return type:

bool

abstractmethod is_recordable(variable: str) bool[source]

Determine if the given variable can be recorded.

Parameters:

variable (str) – The name of the variable

Return type:

bool

abstract property model_name: str

The name of the model.

Return type:

str

abstract property structs: Sequence[Struct]

A list of structures used by the implementation.

Return type:

list(Struct)

class spynnaker.pyNN.models.neuron.implementations.AbstractStandardNeuronComponent(structs: List[Struct], units: Dict[str, str])

Bases: object

Represents a component of a standard neural model.

Parameters:
  • structs (list(Struct)) – The structures of the component

  • units (dict) – The units to use for each parameter

abstractmethod add_parameters(parameters: RangeDictionary[float]) None[source]

Add the initial values of the parameters to the parameter holder.

Parameters:

parameters (RangeDictionary) – A holder of the parameters

abstractmethod add_state_variables(state_variables: RangeDictionary[float]) None[source]

Add the initial values of the state variables to the state variables holder.

Parameters:

state_variables (RangeDictionary) – A holder of the state variables

get_units(variable: str) str[source]

Get the units of the given variable.

Parameters:

variable (str) – The name of the variable

has_variable(variable: str) bool[source]

Determine if this component has a variable by the given name.

Parameters:

variable (str) – The name of the variable

Return type:

bool

property structs: List[Struct]

The structures of the component. If there are multiple structures, the order is how they will appear in memory; where there are structures that repeat per neuron the repeats will appear adjacent e.g. for non-repeating structure g, followed by repeating structures s1 and s2 with 3 neurons the layout will be: [g, s1, s1, s1, s2, s2, s2].

Return type:

list(Struct)

class spynnaker.pyNN.models.neuron.implementations.NeuronImplStandard(model_name: str, binary: str, neuron_model: NeuronModel, input_type: AbstractInputType, synapse_type: AbstractSynapseType, threshold_type: AbstractThresholdType, additional_input_type: AbstractAdditionalInput | None = None)

Bases: AbstractNeuronImpl

The standard componentised neuron implementation.

Parameters:
add_parameters(parameters: RangeDictionary) None[source]

Add the initial values of the parameters to the parameter holder.

Parameters:

parameters (RangeDictionary) – A holder of the parameters

add_state_variables(state_variables: RangeDictionary) None[source]

Add the initial values of the state variables to the state variables holder.

Parameters:

state_variables (RangeDictionary) – A holder of the state variables

property binary_name: str

The name of the binary executable of this implementation.

Return type:

str

get_global_weight_scale() float[source]

Get the weight scaling required by this model.

Return type:

float

get_n_synapse_types() int[source]

Get the number of synapse types supported by the model.

Return type:

int

get_recordable_data_types() Mapping[str, DataType][source]

Get the data type of the variables that can be recorded.

Returns:

dictionary of name of variable to data type of variable

Return type:

dict(str,DataType)

get_recordable_units(variable: str) str[source]

Get the units of the given variable that can be recorded.

Parameters:

variable (str) – The name of the variable

get_recordable_variable_index(variable: str) int[source]

Get the index of the variable in the list of variables that can be recorded.

Parameters:

variable (str) – The name of the variable

Return type:

int

get_recordable_variables() Sequence[str][source]

Get the names of the variables that can be recorded in this model.

Return type:

list(str)

get_synapse_id_by_target(target: str) int | None[source]

Get the ID of a synapse given the name.

Parameters:

target (str) – The name of the synapse

Return type:

int

get_synapse_targets() Sequence[str][source]

Get the target names of the synapse type.

Return type:

list(str)

get_units(variable: str) str[source]

Get the units of the given variable.

Parameters:

variable (str) – The name of the variable

Return type:

str

property is_conductance_based: bool

Whether the model uses conductance.

Return type:

bool

is_recordable(variable: str) bool[source]

Determine if the given variable can be recorded.

Parameters:

variable (str) – The name of the variable

Return type:

bool

property model_name: str

The name of the model.

Return type:

str

property n_steps_per_timestep: int

Get the last set n steps per timestep

Return type:

int

property structs: Sequence[Struct]

A list of structures used by the implementation.

Return type:

list(Struct)

class spynnaker.pyNN.models.neuron.implementations.NeuronImplStocExp(tau: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], bias: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], refract_init: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], seed: int | None)

Bases: AbstractNeuronImpl

Stochastic neuron model exponential threshold and instantaneous synapses, and voltage which is reset each time step.

add_parameters(parameters: RangeDictionary) None[source]

Add the initial values of the parameters to the parameter holder.

Parameters:

parameters (RangeDictionary) – A holder of the parameters

add_state_variables(state_variables: RangeDictionary) None[source]

Add the initial values of the state variables to the state variables holder.

Parameters:

state_variables (RangeDictionary) – A holder of the state variables

property binary_name: str

The name of the binary executable of this implementation.

Return type:

str

get_global_weight_scale() float[source]

Get the weight scaling required by this model.

Return type:

float

get_n_synapse_types() int[source]

Get the number of synapse types supported by the model.

Return type:

int

get_recordable_data_types() Mapping[str, DataType][source]

Get the data type of the variables that can be recorded.

Returns:

dictionary of name of variable to data type of variable

Return type:

dict(str,DataType)

get_recordable_units(variable: str) str[source]

Get the units of the given variable that can be recorded.

Parameters:

variable (str) – The name of the variable

get_recordable_variable_index(variable: str) int[source]

Get the index of the variable in the list of variables that can be recorded.

Parameters:

variable (str) – The name of the variable

Return type:

int

get_recordable_variables() Sequence[str][source]

Get the names of the variables that can be recorded in this model.

Return type:

list(str)

get_synapse_id_by_target(target: str) int | None[source]

Get the ID of a synapse given the name.

Parameters:

target (str) – The name of the synapse

Return type:

int

get_synapse_targets() Sequence[str][source]

Get the target names of the synapse type.

Return type:

list(str)

get_units(variable: str) str[source]

Get the units of the given variable.

Parameters:

variable (str) – The name of the variable

Return type:

str

property is_conductance_based: bool

Whether the model uses conductance.

Return type:

bool

is_recordable(variable: str) bool[source]

Determine if the given variable can be recorded.

Parameters:

variable (str) – The name of the variable

Return type:

bool

property model_name: str

The name of the model.

Return type:

str

property structs: Sequence[Struct]

A list of structures used by the implementation.

Return type:

list(Struct)

class spynnaker.pyNN.models.neuron.implementations.NeuronImplStocExpStable(v_init: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], v_reset: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], tau: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], tau_refrac: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], bias: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], refract_init: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], seed: int | None)

Bases: AbstractNeuronImpl

Stochastic neuron model with exponential threshold and instantaneous synapses, and voltage stays unless changed by input.

add_parameters(parameters: RangeDictionary) None[source]

Add the initial values of the parameters to the parameter holder.

Parameters:

parameters (RangeDictionary) – A holder of the parameters

add_state_variables(state_variables: RangeDictionary) None[source]

Add the initial values of the state variables to the state variables holder.

Parameters:

state_variables (RangeDictionary) – A holder of the state variables

property binary_name: str

The name of the binary executable of this implementation.

Return type:

str

get_global_weight_scale() float[source]

Get the weight scaling required by this model.

Return type:

float

get_n_synapse_types() int[source]

Get the number of synapse types supported by the model.

Return type:

int

get_recordable_data_types() Mapping[str, DataType][source]

Get the data type of the variables that can be recorded.

Returns:

dictionary of name of variable to data type of variable

Return type:

dict(str,DataType)

get_recordable_units(variable: str) str[source]

Get the units of the given variable that can be recorded.

Parameters:

variable (str) – The name of the variable

get_recordable_variable_index(variable: str) int[source]

Get the index of the variable in the list of variables that can be recorded.

Parameters:

variable (str) – The name of the variable

Return type:

int

get_recordable_variables() Sequence[str][source]

Get the names of the variables that can be recorded in this model.

Return type:

list(str)

get_synapse_id_by_target(target: str) int | None[source]

Get the ID of a synapse given the name.

Parameters:

target (str) – The name of the synapse

Return type:

int

get_synapse_targets() Sequence[str][source]

Get the target names of the synapse type.

Return type:

list(str)

get_units(variable: str) str[source]

Get the units of the given variable.

Parameters:

variable (str) – The name of the variable

Return type:

str

property is_conductance_based: bool

Whether the model uses conductance.

Return type:

bool

is_recordable(variable: str) bool[source]

Determine if the given variable can be recorded.

Parameters:

variable (str) – The name of the variable

Return type:

bool

property model_name: str

The name of the model.

Return type:

str

property structs: Sequence[Struct]

A list of structures used by the implementation.

Return type:

list(Struct)

class spynnaker.pyNN.models.neuron.implementations.NeuronImplStocSigma(tau_refrac: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], alpha: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], bias: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], refract_init: float | Iterable[float] | RandomDistribution | ndarray[tuple[int, ...], dtype[floating]], seed: int | None)

Bases: AbstractNeuronImpl

Stochastic model with sigma threshold and instantaneous synapses.

add_parameters(parameters: RangeDictionary) None[source]

Add the initial values of the parameters to the parameter holder.

Parameters:

parameters (RangeDictionary) – A holder of the parameters

add_state_variables(state_variables: RangeDictionary) None[source]

Add the initial values of the state variables to the state variables holder.

Parameters:

state_variables (RangeDictionary) – A holder of the state variables

property binary_name: str

The name of the binary executable of this implementation.

Return type:

str

get_global_weight_scale() float[source]

Get the weight scaling required by this model.

Return type:

float

get_n_synapse_types() int[source]

Get the number of synapse types supported by the model.

Return type:

int

get_recordable_data_types() Mapping[str, DataType][source]

Get the data type of the variables that can be recorded.

Returns:

dictionary of name of variable to data type of variable

Return type:

dict(str,DataType)

get_recordable_units(variable: str) str[source]

Get the units of the given variable that can be recorded.

Parameters:

variable (str) – The name of the variable

get_recordable_variable_index(variable: str) int[source]

Get the index of the variable in the list of variables that can be recorded.

Parameters:

variable (str) – The name of the variable

Return type:

int

get_recordable_variables() Sequence[str][source]

Get the names of the variables that can be recorded in this model.

Return type:

list(str)

get_synapse_id_by_target(target: str) int | None[source]

Get the ID of a synapse given the name.

Parameters:

target (str) – The name of the synapse

Return type:

int

get_synapse_targets() Sequence[str][source]

Get the target names of the synapse type.

Return type:

list(str)

get_units(variable: str) str[source]

Get the units of the given variable.

Parameters:

variable (str) – The name of the variable

Return type:

str

property is_conductance_based: bool

Whether the model uses conductance.

Return type:

bool

is_recordable(variable: str) bool[source]

Determine if the given variable can be recorded.

Parameters:

variable (str) – The name of the variable

Return type:

bool

property model_name: str

The name of the model.

Return type:

str

property structs: Sequence[Struct]

A list of structures used by the implementation.

Return type:

list(Struct)