spynnaker.pyNN.models.neuron.implementations package¶
Module contents¶
- class spynnaker.pyNN.models.neuron.implementations.AbstractNeuronImpl¶
Bases:
objectAn 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 – 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 – A holder of the state variables
- abstractmethod get_global_weight_scale() float[source]¶
- Returns:
The weight scaling required by this model.
- abstractmethod get_n_synapse_types() int[source]¶
- Returns:
The number of synapse types supported by the model.
- 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
- abstractmethod get_recordable_units(variable: str) str[source]¶
Get the units of the given variable that can be recorded.
- Parameters:
variable – The name of the variable
- Returns:
The unit or this variable. For example ‘mV’ or ‘uS’. Will be an empty string for things like spikes and probability
- abstractmethod get_recordable_variable_index(variable: str) int[source]¶
- Parameters:
variable – The name of the variable
- Returns:
The index of the variable in the list of variables that can be recorded.
- abstractmethod get_recordable_variables() Sequence[str][source]¶
- Returns:
The names of the variables that can be recorded in this model.
- abstractmethod get_synapse_id_by_target(target: str) int | None[source]¶
- Parameters:
target – The name of the synapse
- Returns:
The ID of a synapse given the name.
- abstractmethod get_synapse_targets() Sequence[str][source]¶
- Returns:
The target names of the synapse type.
- abstractmethod get_units(variable: str) str[source]¶
- Parameters:
variable – The name of the variable
- Returns:
The units of the given variable.
- class spynnaker.pyNN.models.neuron.implementations.AbstractStandardNeuronComponent(structs: List[Struct], units: Dict[str, str])¶
Bases:
objectRepresents a component of a standard neural model.
- Parameters:
structs – The structures of the component
units – 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 – 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 – A holder of the state variables
- get_units(variable: str) str[source]¶
- Parameters:
variable – The name of the variable
- Returns:
The units of the given variable.
- has_variable(variable: str) bool[source]¶
Determine if this component has a variable by the given name.
- Parameters:
variable – The name of the variable
- Returns:
True if the variable exists, False otherwise
- 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].
- 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:
AbstractNeuronImplThe standard componentised neuron implementation.
- Parameters:
model_name
binary
neuron_model
input_type
synapse_type
threshold_type
additional_input_type
- add_parameters(parameters: RangeDictionary) None[source]¶
Add the initial values of the parameters to the parameter holder.
- Parameters:
parameters – 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 – A holder of the state variables
- 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
- get_recordable_units(variable: str) str[source]¶
Get the units of the given variable that can be recorded.
- Parameters:
variable – The name of the variable
- Returns:
The unit or this variable. For example ‘mV’ or ‘uS’. Will be an empty string for things like spikes and probability
- get_recordable_variable_index(variable: str) int[source]¶
- Parameters:
variable – The name of the variable
- Returns:
The index of the variable in the list of variables that can be recorded.
- get_recordable_variables() Sequence[str][source]¶
- Returns:
The names of the variables that can be recorded in this model.
- get_synapse_id_by_target(target: str) int | None[source]¶
- Parameters:
target – The name of the synapse
- Returns:
The ID of a synapse given the name.
- get_units(variable: str) str[source]¶
- Parameters:
variable – The name of the variable
- Returns:
The units of the given variable.
- class spynnaker.pyNN.models.neuron.implementations.NeuronImplStocExp(tau: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], bias: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], refract_init: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], seed: int | None)¶
Bases:
AbstractNeuronImplStochastic neuron model exponential threshold and instantaneous synapses, and voltage which is reset each time step.
- Parameters:
tau – \(\tau_m\)
bias
refract_init
seed – Seed for the random distribution
- add_parameters(parameters: RangeDictionary) None[source]¶
Add the initial values of the parameters to the parameter holder.
- Parameters:
parameters – 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 – A holder of the state variables
- 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
- get_recordable_units(variable: str) str[source]¶
Get the units of the given variable that can be recorded.
- Parameters:
variable – The name of the variable
- Returns:
The unit or this variable. For example ‘mV’ or ‘uS’. Will be an empty string for things like spikes and probability
- get_recordable_variable_index(variable: str) int[source]¶
- Parameters:
variable – The name of the variable
- Returns:
The index of the variable in the list of variables that can be recorded.
- get_recordable_variables() Sequence[str][source]¶
- Returns:
The names of the variables that can be recorded in this model.
- get_synapse_id_by_target(target: str) int | None[source]¶
- Parameters:
target – The name of the synapse
- Returns:
The ID of a synapse given the name.
- get_units(variable: str) str[source]¶
- Parameters:
variable – The name of the variable
- Returns:
The units of the given variable.
- class spynnaker.pyNN.models.neuron.implementations.NeuronImplStocExpStable(v_init: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], v_reset: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], tau: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], tau_refrac: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], bias: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], refract_init: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], seed: int | None)¶
Bases:
AbstractNeuronImplStochastic neuron model with exponential threshold and instantaneous synapses, and voltage stays unless changed by input.
- Parameters:
v_init – \(V_{init}\)
v_reset – \(V_{thresh}\)
tau
tau_refrac
bias
refract_init
seed – Seed for the random distribution
- add_parameters(parameters: RangeDictionary) None[source]¶
Add the initial values of the parameters to the parameter holder.
- Parameters:
parameters – 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 – A holder of the state variables
- 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
- get_recordable_units(variable: str) str[source]¶
Get the units of the given variable that can be recorded.
- Parameters:
variable – The name of the variable
- Returns:
The unit or this variable. For example ‘mV’ or ‘uS’. Will be an empty string for things like spikes and probability
- get_recordable_variable_index(variable: str) int[source]¶
- Parameters:
variable – The name of the variable
- Returns:
The index of the variable in the list of variables that can be recorded.
- get_recordable_variables() Sequence[str][source]¶
- Returns:
The names of the variables that can be recorded in this model.
- get_synapse_id_by_target(target: str) int | None[source]¶
- Parameters:
target – The name of the synapse
- Returns:
The ID of a synapse given the name.
- get_units(variable: str) str[source]¶
- Parameters:
variable – The name of the variable
- Returns:
The units of the given variable.
- class spynnaker.pyNN.models.neuron.implementations.NeuronImplStocSigma(tau_refrac: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], alpha: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], bias: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], refract_init: float | Iterable[float] | RandomDistribution | ndarray[tuple[Any, ...], dtype[floating]], seed: int | None)¶
Bases:
AbstractNeuronImplStochastic model with sigma threshold and instantaneous synapses.
- Parameters:
tau_refrac
alpha
bias
refract_init
seed – Seed for the random distribution
- add_parameters(parameters: RangeDictionary) None[source]¶
Add the initial values of the parameters to the parameter holder.
- Parameters:
parameters – 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 – A holder of the state variables
- 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
- get_recordable_units(variable: str) str[source]¶
Get the units of the given variable that can be recorded.
- Parameters:
variable – The name of the variable
- Returns:
The unit or this variable. For example ‘mV’ or ‘uS’. Will be an empty string for things like spikes and probability
- get_recordable_variable_index(variable: str) int[source]¶
- Parameters:
variable – The name of the variable
- Returns:
The index of the variable in the list of variables that can be recorded.
- get_recordable_variables() Sequence[str][source]¶
- Returns:
The names of the variables that can be recorded in this model.
- get_synapse_id_by_target(target: str) int | None[source]¶
- Parameters:
target – The name of the synapse
- Returns:
The ID of a synapse given the name.
- get_units(variable: str) str[source]¶
- Parameters:
variable – The name of the variable
- Returns:
The units of the given variable.