spynnaker.pyNN.models.neuron.neuron_models package¶
Submodules¶
spynnaker.pyNN.models.neuron.neuron_models.abstract_neuron_model module¶
-
class
spynnaker.pyNN.models.neuron.neuron_models.abstract_neuron_model.
AbstractNeuronModel
(data_types, global_data_types=None)[source]¶ -
Represents a neuron model.
Parameters: - data_types – A list of data types in the neuron structure, in the order that they appear
- global_data_types – A list of data types in the neuron global structure, in the order that they appear
-
get_data
(parameters, state_variables, vertex_slice)[source]¶ Get the data to be written to the machine for this model
Parameters: - parameters (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the parameters - state_variables (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the state variables - vertex_slice – The slice of the vertex to generate parameters for
Return type: numpy array of uint32
- parameters (
-
get_dtcm_usage_in_bytes
(n_neurons)[source]¶ Get the DTCM memory usage required
Parameters: n_neurons (int) – The number of neurons to get the usage for Return type: int
-
get_global_values
()[source]¶ Get the global values to be written to the machine for this model
Returns: A list with the same length as self.global_struct.field_types Return type: A list of single values
-
get_sdram_usage_in_bytes
(n_neurons)[source]¶ Get the SDRAM memory usage required
Parameters: n_neurons (int) – The number of neurons to get the usage for Return type: int
-
global_struct
¶ Get the global parameters structure
-
read_data
(data, offset, vertex_slice, parameters, state_variables)[source]¶ Read the parameters and state variables of the model from the given data
Parameters: - data – The data to be read
- offset – The offset where the data should be read from
- vertex_slice – The slice of the vertex to read parameters for
- parameters (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the parameters to update - state_variables (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the state variables to update
Returns: The offset after reading the data
spynnaker.pyNN.models.neuron.neuron_models.neuron_model_izh module¶
-
class
spynnaker.pyNN.models.neuron.neuron_models.neuron_model_izh.
NeuronModelIzh
(a, b, c, d, v_init, u_init, i_offset)[source]¶ Bases:
spynnaker.pyNN.models.neuron.neuron_models.abstract_neuron_model.AbstractNeuronModel
-
a
¶
-
add_parameters
(parameters)[source]¶ Add the initial values of the parameters to the parameter holder
Parameters: parameters ( spinn_utilities.ranged.range_dictionary.RangeDictionary
) – A holder of the parameters
-
add_state_variables
(state_variables)[source]¶ Add the initial values of the state variables to the state variables holder
Parameters: state_variables ( spinn_utilities.ranged.range_dictionary.RangeDictionary
) – A holder of the state variables
-
b
¶
-
c
¶
-
d
¶
-
get_global_values
(machine_time_step)[source]¶ Get the global values to be written to the machine for this model
Returns: A list with the same length as self.global_struct.field_types Return type: A list of single values
-
get_n_cpu_cycles
(n_neurons)[source]¶ Get the number of CPU cycles required to update the state
Parameters: n_neurons (int) – The number of neurons to get the cycles for Return type: int
-
get_units
(variable)[source]¶ Get the units of the given variable
Parameters: variable (str) – The name of the variable
-
get_values
(parameters, state_variables, vertex_slice, ts)[source]¶ Get the values to be written to the machine for this model
Parameters: - parameters (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the parameters - state_variables (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the state variables - vertex_slice – The slice of variables being retrieved
Returns: A list with the same length as self.struct.field_types
Return type: A list of (single value or list of values or RangedList)
- parameters (
-
has_variable
(variable)[source]¶ Determine if this component has a variable by the given name
Parameters: variable (str) – The name of the variable Return type: bool
-
i_offset
¶
-
u_init
¶
-
update_values
(values, parameters, state_variables)[source]¶ Update the parameters and state variables with the given struct values that have been read from the machine
Parameters: - values – The values read from the machine, one for each struct element
- parameters – The holder of the parameters to update
- state_variables – The holder of the state variables to update
-
v_init
¶
-
spynnaker.pyNN.models.neuron.neuron_models.neuron_model_leaky_integrate_and_fire module¶
-
class
spynnaker.pyNN.models.neuron.neuron_models.neuron_model_leaky_integrate_and_fire.
NeuronModelLeakyIntegrateAndFire
(v_init, v_rest, tau_m, cm, i_offset, v_reset, tau_refrac)[source]¶ Bases:
spynnaker.pyNN.models.neuron.neuron_models.abstract_neuron_model.AbstractNeuronModel
-
add_parameters
(parameters)[source]¶ Add the initial values of the parameters to the parameter holder
Parameters: parameters ( spinn_utilities.ranged.range_dictionary.RangeDictionary
) – A holder of the parameters
-
add_state_variables
(state_variables)[source]¶ Add the initial values of the state variables to the state variables holder
Parameters: state_variables ( spinn_utilities.ranged.range_dictionary.RangeDictionary
) – A holder of the state variables
-
cm
¶
-
get_n_cpu_cycles
(n_neurons)[source]¶ Get the number of CPU cycles required to update the state
Parameters: n_neurons (int) – The number of neurons to get the cycles for Return type: int
-
get_units
(variable)[source]¶ Get the units of the given variable
Parameters: variable (str) – The name of the variable
-
get_values
(parameters, state_variables, vertex_slice, ts)[source]¶ Get the values to be written to the machine for this model
Parameters: - parameters (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the parameters - state_variables (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the state variables - vertex_slice – The slice of variables being retrieved
Returns: A list with the same length as self.struct.field_types
Return type: A list of (single value or list of values or RangedList)
- parameters (
-
has_variable
(variable)[source]¶ Determine if this component has a variable by the given name
Parameters: variable (str) – The name of the variable Return type: bool
-
i_offset
¶
-
tau_m
¶
-
tau_refrac
¶
-
update_values
(values, parameters, state_variables)[source]¶ Update the parameters and state variables with the given struct values that have been read from the machine
Parameters: - values – The values read from the machine, one for each struct element
- parameters – The holder of the parameters to update
- state_variables – The holder of the state variables to update
-
v_init
¶
-
v_reset
¶
-
v_rest
¶
-
Module contents¶
-
class
spynnaker.pyNN.models.neuron.neuron_models.
AbstractNeuronModel
(data_types, global_data_types=None)[source]¶ -
Represents a neuron model.
Parameters: - data_types – A list of data types in the neuron structure, in the order that they appear
- global_data_types – A list of data types in the neuron global structure, in the order that they appear
-
get_data
(parameters, state_variables, vertex_slice)[source]¶ Get the data to be written to the machine for this model
Parameters: - parameters (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the parameters - state_variables (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the state variables - vertex_slice – The slice of the vertex to generate parameters for
Return type: numpy array of uint32
- parameters (
-
get_dtcm_usage_in_bytes
(n_neurons)[source]¶ Get the DTCM memory usage required
Parameters: n_neurons (int) – The number of neurons to get the usage for Return type: int
-
get_global_values
()[source]¶ Get the global values to be written to the machine for this model
Returns: A list with the same length as self.global_struct.field_types Return type: A list of single values
-
get_sdram_usage_in_bytes
(n_neurons)[source]¶ Get the SDRAM memory usage required
Parameters: n_neurons (int) – The number of neurons to get the usage for Return type: int
-
global_struct
¶ Get the global parameters structure
-
read_data
(data, offset, vertex_slice, parameters, state_variables)[source]¶ Read the parameters and state variables of the model from the given data
Parameters: - data – The data to be read
- offset – The offset where the data should be read from
- vertex_slice – The slice of the vertex to read parameters for
- parameters (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the parameters to update - state_variables (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the state variables to update
Returns: The offset after reading the data
-
class
spynnaker.pyNN.models.neuron.neuron_models.
NeuronModelIzh
(a, b, c, d, v_init, u_init, i_offset)[source]¶ Bases:
spynnaker.pyNN.models.neuron.neuron_models.abstract_neuron_model.AbstractNeuronModel
-
a
¶
-
add_parameters
(parameters)[source]¶ Add the initial values of the parameters to the parameter holder
Parameters: parameters ( spinn_utilities.ranged.range_dictionary.RangeDictionary
) – A holder of the parameters
-
add_state_variables
(state_variables)[source]¶ Add the initial values of the state variables to the state variables holder
Parameters: state_variables ( spinn_utilities.ranged.range_dictionary.RangeDictionary
) – A holder of the state variables
-
b
¶
-
c
¶
-
d
¶
-
get_global_values
(machine_time_step)[source]¶ Get the global values to be written to the machine for this model
Returns: A list with the same length as self.global_struct.field_types Return type: A list of single values
-
get_n_cpu_cycles
(n_neurons)[source]¶ Get the number of CPU cycles required to update the state
Parameters: n_neurons (int) – The number of neurons to get the cycles for Return type: int
-
get_units
(variable)[source]¶ Get the units of the given variable
Parameters: variable (str) – The name of the variable
-
get_values
(parameters, state_variables, vertex_slice, ts)[source]¶ Get the values to be written to the machine for this model
Parameters: - parameters (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the parameters - state_variables (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the state variables - vertex_slice – The slice of variables being retrieved
Returns: A list with the same length as self.struct.field_types
Return type: A list of (single value or list of values or RangedList)
- parameters (
-
has_variable
(variable)[source]¶ Determine if this component has a variable by the given name
Parameters: variable (str) – The name of the variable Return type: bool
-
i_offset
¶
-
u_init
¶
-
update_values
(values, parameters, state_variables)[source]¶ Update the parameters and state variables with the given struct values that have been read from the machine
Parameters: - values – The values read from the machine, one for each struct element
- parameters – The holder of the parameters to update
- state_variables – The holder of the state variables to update
-
v_init
¶
-
-
class
spynnaker.pyNN.models.neuron.neuron_models.
NeuronModelLeakyIntegrateAndFire
(v_init, v_rest, tau_m, cm, i_offset, v_reset, tau_refrac)[source]¶ Bases:
spynnaker.pyNN.models.neuron.neuron_models.abstract_neuron_model.AbstractNeuronModel
-
add_parameters
(parameters)[source]¶ Add the initial values of the parameters to the parameter holder
Parameters: parameters ( spinn_utilities.ranged.range_dictionary.RangeDictionary
) – A holder of the parameters
-
add_state_variables
(state_variables)[source]¶ Add the initial values of the state variables to the state variables holder
Parameters: state_variables ( spinn_utilities.ranged.range_dictionary.RangeDictionary
) – A holder of the state variables
-
cm
¶
-
get_n_cpu_cycles
(n_neurons)[source]¶ Get the number of CPU cycles required to update the state
Parameters: n_neurons (int) – The number of neurons to get the cycles for Return type: int
-
get_units
(variable)[source]¶ Get the units of the given variable
Parameters: variable (str) – The name of the variable
-
get_values
(parameters, state_variables, vertex_slice, ts)[source]¶ Get the values to be written to the machine for this model
Parameters: - parameters (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the parameters - state_variables (
spinn_utilities.ranged.range_dictionary.RangeDictionary
) – The holder of the state variables - vertex_slice – The slice of variables being retrieved
Returns: A list with the same length as self.struct.field_types
Return type: A list of (single value or list of values or RangedList)
- parameters (
-
has_variable
(variable)[source]¶ Determine if this component has a variable by the given name
Parameters: variable (str) – The name of the variable Return type: bool
-
i_offset
¶
-
tau_m
¶
-
tau_refrac
¶
-
update_values
(values, parameters, state_variables)[source]¶ Update the parameters and state variables with the given struct values that have been read from the machine
Parameters: - values – The values read from the machine, one for each struct element
- parameters – The holder of the parameters to update
- state_variables – The holder of the state variables to update
-
v_init
¶
-
v_reset
¶
-
v_rest
¶
-