spynnaker.pyNN.models.neuron.neuron_models package

Module contents

class spynnaker.pyNN.models.neuron.neuron_models.AbstractNeuronModel(data_types, global_data_types=None)[source]

Bases: spynnaker.pyNN.models.neuron.implementations.abstract_standard_neuron_component.AbstractStandardNeuronComponent

Represents a neuron model.

Parameters:
  • data_types (list(DataType)) – A list of data types in the neuron structure, in the order that they appear
  • global_data_types (list(DataType) or None) – A list of data types in the neuron global structure, in the order that they appear
get_data(parameters, state_variables, vertex_slice, ts)[source]

Get the data to be written to the machine for this model.

Parameters:
  • parameters (RangeDictionary) – The holder of the parameters
  • state_variables (RangeDictionary) – The holder of the state variables
  • vertex_slice (Slice) – The slice of the vertex to generate parameters for
Return type:

ndarray(uint32)

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(ts)[source]

Get the global values to be written to the machine for this model

Parameters:ts (float) – The time to advance the model at each call
Returns:A list with the same length as self.global_struct.field_types
Return type:list(int or float) or ndarray
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

Return type:Struct
read_data(data, offset, vertex_slice, parameters, state_variables)[source]

Read the parameters and state variables of the model from the given data (read from the machine)

Parameters:
  • data (bytes or bytearray) – The data to be read
  • offset (int) – The offset where the data should be read from
  • vertex_slice (Slice) – The slice of the vertex to read parameters for
  • parameters (RangeDictionary) – The holder of the parameters to update
  • state_variables (RangeDictionary) – The holder of the state variables to update
Returns:

The offset after reading the data

Return type:

int

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

Model of neuron due to Eugene M. Izhikevich et al

Parameters:
a

Settable model parameter: \(a\)

Return type:float
add_parameters(parameters)[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)[source]

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

Parameters:state_variables (RangeDictionary) – A holder of the state variables
b

Settable model parameter: \(b\)

Return type:float
c

Settable model parameter: \(c\)

Return type:float
d

Settable model parameter: \(d\)

Return type:float
get_global_values(ts)[source]

Get the global values to be written to the machine for this model

Parameters:ts (float) – The time to advance the model at each call
Returns:A list with the same length as self.global_struct.field_types
Return type:list(int or float) or ndarray
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 (RangeDictionary) – The holder of the parameters
  • state_variables (RangeDictionary) – The holder of the state variables
  • vertex_slice (Slice) – The slice of variables being retrieved
  • ts (float) – The time to be advanced in one call to the update of this component
  • ts – machine time step
Returns:

A list with the same length as self.struct.field_types

Return type:

list(int or float or list(int) or list(float) or RangedList)

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

Settable model parameter: \(I_{offset}\)

Return type:float
u_init

Settable model parameter: \(u_{init}\)

Return type:float
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 (list(list)) – The values read from the machine, one for each struct element
  • parameters (RangeDictionary) – The holder of the parameters to update
  • state_variables (RangeDictionary) – The holder of the state variables to update
v_init

Settable model parameter: \(v_{init}\)

Return type:float
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

Classic leaky integrate and fire neuron model.

Parameters:
add_parameters(parameters)[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)[source]

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

Parameters:state_variables (RangeDictionary) – A holder of the state variables
cm

Settable model parameter: \(C_m\)

Return type:float
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 (RangeDictionary) – The holder of the parameters
  • state_variables (RangeDictionary) – The holder of the state variables
  • vertex_slice (Slice) – The slice of variables being retrieved
  • ts (int) – The time to be advanced in one call to the update of this component
  • ts – machine time step
Returns:

A list with the same length as self.struct.field_types

Return type:

list(int or float or list(int) or list(float) or RangedList)

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

Settable model parameter: \(I_{offset}\)

Return type:float
tau_m

Settable model parameter: \(\tau_{m}\)

Return type:float
tau_refrac

Settable model parameter: \(\tau_{refrac}\)

Return type:float
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 (list(list)) – The values read from the machine, one for each struct element
  • parameters (RangeDictionary) – The holder of the parameters to update
  • state_variables (RangeDictionary) – The holder of the state variables to update
v_init

Settable model parameter: \(V_{init}\)

Return type:float
v_reset

Settable model parameter: \(V_{reset}\)

Return type:float
v_rest

Settable model parameter: \(V_{rest}\)

Return type:float