spynnaker.pyNN.models.abstract_models package

Module contents

class spynnaker.pyNN.models.abstract_models.AbstractAcceptsIncomingSynapses[source]

Bases: object

Indicates an application vertex that can be a post-vertex in a PyNN projection.

clear_connection_cache()[source]

Clear the connection data stored in the vertex so far.

get_connections_from_machine(transceiver, placements, app_edge, synapse_info)[source]

Get the connections from the machine post-run.

Parameters:
get_synapse_id_by_target(target)[source]

Get the ID of a synapse given the name.

Parameters:target (str) – The name of the synapse
Return type:int
set_synapse_dynamics(synapse_dynamics)[source]

Set the synapse dynamics of this vertex.

Parameters:synapse_dynamics (AbstractSynapseDynamics) –
verify_splitter(splitter)[source]

Check that the splitter implements the API(s) expected by the SynapticMatrices

Any Vertex that implements this api should override ApplicationVertex.splitter method to also call this function

Parameters:splitter (AbstractSpynnakerSplitterDelay) – the splitter
Raises:PacmanConfigurationException – if the splitter is not an instance of AbstractSpynnakerSplitterDelay
class spynnaker.pyNN.models.abstract_models.AbstractContainsUnits[source]

Bases: object

Indicates an application vertex class that can describe the units of some of its variables.

get_units(variable)[source]

Get units for a given variable.

Parameters:variable (str) – the variable to find units from
Returns:the units as a string.
Return type:str
class spynnaker.pyNN.models.abstract_models.AbstractHasDelayStages[source]

Bases: object

Indicates that this object (an application vertex) has delay stages that are used to increase the space required for bitfields in spynnaker.pyNN.utilities.bit_field_utilities.get_estimated_sdram_for_bit_field_region()

n_delay_stages

The maximum number of delay stages required by any connection out of this delay extension vertex

Return type:int
class spynnaker.pyNN.models.abstract_models.AbstractMaxSpikes[source]

Bases: object

Indicates a class (a MachineVertex) that can describe the maximum rate that it sends spikes.

The SynapticManager assumes that all machine vertexes share the same synapse_information will have the same rates.

max_spikes_per_second()[source]

Get maximum expected number of spikes per second

Parameters:variable (str) – the variable to find units from
Returns:the units as a string.
Return type:str
max_spikes_per_ts()[source]

Get maximum expected number of spikes per timestep

Return type:int
class spynnaker.pyNN.models.abstract_models.AbstractPopulationInitializable[source]

Bases: object

Indicates that this application vertex has properties that can be initialised by a PyNN Population

get_initial_value(variable, selector=None)[source]

Gets the value for any variable whose in initialize_parameters.keys

Should return the current value not the default one.

Must support the variable as listed in initialize_parameters.keys, ideally also with _init removed or added.

Parameters:
Returns:

A list or an Object which act like a list

Return type:

iterable

get_initial_values(selector=None)[source]

A dict containing the initial values of the state variables.

Parameters:selector (None or slice or int or list(bool) or list(int)) – a description of the subrange to accept, or None for all. See: selector_to_ids()
Return type:dict(str,Any)
initial_values

A dict containing the initial values of the state variables.

Return type:dict(str,Any)
initialize(variable, value, selector=None)[source]

Set the initial value of one of the state variables of the neurons in this population.

Parameters:
  • variable (str) – The name of the variable to set
  • value (float or int or Any) – The value of the variable to set
initialize_parameters

List the parameters that are initializable.

If “foo” is initializable there should be a setter initialize_foo and a getter property foo_init

Returns:list of property names
Return type:iterable(str)
class spynnaker.pyNN.models.abstract_models.AbstractPopulationSettable[source]

Bases: spynnaker.pyNN.models.abstract_models.abstract_settable.AbstractSettable

Indicates that some properties of this application vertex can be accessed from the PyNN population set and get methods.

get_value_by_selector(selector, key)[source]

Gets the value for a particular key but only for the selected subset.

Parameters:
  • selector (None or slice or int or list(bool) or list(int)) – See get_value_by_selector() as this is just a pass through method
  • key (str) – the name of the parameter to change
Return type:

list(float or int)

n_atoms

” See n_atoms()

set_value_by_selector(selector, key, value)[source]

Sets the value for a particular key but only for the selected subset.

Parameters:
class spynnaker.pyNN.models.abstract_models.AbstractReadParametersBeforeSet[source]

Bases: object

A vertex whose parameters must be read before any can be set.

read_parameters_from_machine(transceiver, placement, vertex_slice)[source]

Read the parameters from the machine before any are changed.

Parameters:
  • transceiver (Transceiver) – the SpinnMan interface
  • placement (Placement) – the placement of a vertex
  • vertex_slice (Slice) – the slice of atoms for this vertex
Return type:

None

class spynnaker.pyNN.models.abstract_models.AbstractSettable[source]

Bases: object

Indicates that some properties of this object can be accessed from the PyNN population set and get methods.

get_value(key)[source]

Get a property

Parameters:key (str) – the name of the property
Return type:Any or float or int or list(float) or list(int)
set_value(key, value)[source]

Set a property

Parameters:
  • key (str) – the name of the parameter to change
  • value (Any or float or int or list(float) or list(int)) – the new value of the parameter to assign
class spynnaker.pyNN.models.abstract_models.AbstractSynapseExpandable[source]

Bases: object

Indicates a class (a MachineVertex) that has may need to run the SYNAPSE_EXPANDER aplx

Note

This is not implemented by the DelayExtensionMachineVertex, which needs a different expander aplx

connection_generator_region

The region containing the parameters of synaptic expansion

Return type:int
Return type:bool
gen_on_machine()[source]

True if the synapses of a the slice of this vertex should be generated on the machine.

Note

The typical implementation for this method will be to ask the app_vertex’s synapse_manager

Return type:bool
read_generated_connection_holders(transceiver, placement)[source]

Fill in the connection holders

Parameters:
  • transceiver (Transceiver) – How the data is to be read
  • placement (Placement) – Where the data is on the machine
class spynnaker.pyNN.models.abstract_models.AbstractWeightUpdatable[source]

Bases: object

An object whose weight can be updated.

update_weight()[source]

Update the weight.

class spynnaker.pyNN.models.abstract_models.SendsSynapticInputsOverSDRAM[source]

Bases: pacman.model.graphs.abstract_supports_sdram_edges.AbstractSupportsSDRAMEdges

A marker interface for an object that sends synaptic inputs over SDRAM

class spynnaker.pyNN.models.abstract_models.ReceivesSynapticInputsOverSDRAM[source]

Bases: pacman.model.graphs.abstract_supports_sdram_edges.AbstractSupportsSDRAMEdges

An object that receives synaptic inputs over SDRAM.

The number of neurons to be sent per synapse type is rounded up to be a power of 2. A sender must send N_BYTES_PER_INPUT of data for each synapse type for each neuron, formatted as all the data for each neuron for the first synapse type, followed by all the data for each neuron for the second, and so on for each synapse type. Each input is an accumulated weight value for the timestep, scaled with the given weight scales.

N_BYTES_PER_INPUT = 2
n_bytes_for_transfer
The number of bytes to be sent over the channel. This will be
calculated using the above numbers, but also rounded up to a number of words, and with the number of neurons rounded up to a power of 2
Return type:int
n_target_neurons

The number of neurons expecting to receive input

Return type:int
n_target_synapse_types

The number of synapse types expecting to receive input

Return type:int
weight_scales
A list of scale factors to be applied to weights that get passed
over SDRAM, one for each synapse type.
Return type:list(int)
class spynnaker.pyNN.models.abstract_models.HasSynapses[source]

Bases: object

clear_connection_cache()[source]

Flush the cache of connection information; needed for a second run

get_connections_from_machine(transceiver, placement, app_edge, synapse_info)[source]

Get the connections from the machine for this vertex.

Parameters:
  • transceiver (Transceiver) – How to read the connection data
  • placement (Placement) – Where the connection data is on the machine
  • app_edge (ProjectionApplicationEdge) – The edge for which the data is being read
  • synapse_info (SynapseInformation) – The specific projection within the edge