spynnaker.pyNN.models.abstract_models package

Module contents

class spynnaker.pyNN.models.abstract_models.AbstractAcceptsIncomingSynapses

Bases: object

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

abstract clear_connection_cache()[source]

Clear the connection data stored in the vertex so far.

abstract get_connections_from_machine(app_edge, synapse_info)[source]

Get the connections from the machine post-run.

Parameters:
Return type:

ndarray

abstract 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

abstract 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.AbstractHasDelayStages

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()

abstract property 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

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.

abstract 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

abstract max_spikes_per_ts()[source]

Get maximum expected number of spikes per timestep.

Return type:

int

class spynnaker.pyNN.models.abstract_models.AbstractNeuronExpandable

Bases: object

Indicates a class (a MachineVertex) that has may need to run the neuron expander APLX.

abstract gen_neurons_on_machine()[source]

True if the neurons 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 neuron data

Return type:

bool

abstract property neuron_generator_region

The region containing the parameters of neuron expansion.

Return type:

int

abstract read_generated_initial_values(placement)[source]

Fill in any requested initial values.

Parameters:

placement (Placement) – Where the data is on the machine

class spynnaker.pyNN.models.abstract_models.AbstractSynapseExpandable

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

abstract property bit_field_size

The amount of bit field data to be generated. This is used to calculate the timeout of the execution.

Return type:

int

abstract property connection_generator_region

The region ID containing the parameters of synaptic expansion.

Return type:

int

abstract 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

abstract property max_gen_data

The maximum amount of synaptic data to be generated. This is used to calculate the timeout of the execution.

Return type:

int

abstract read_generated_connection_holders(placement)[source]

Fill in the connection holders.

Parameters:

placement (Placement) – Where the data is on the machine

class spynnaker.pyNN.models.abstract_models.HasShapeKeyFields

Bases: object

Indicates a source that has keys in fields for each dimension of the source.

abstract get_shape_key_fields(vertex_slice)[source]

Get the fields to be used for each dimension in the shape of the given source vertex slice, as a list of start, size, mask, shift values in the order of the fields.

Parameters:

vertex_slice (Slice) – The slice of the source vertex

Return type:

list(tuple(int, int, int, int))

class spynnaker.pyNN.models.abstract_models.HasSynapses

Bases: object

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

Get the connections from the machine for this vertex.

Parameters:
Return type:

ndarray

class spynnaker.pyNN.models.abstract_models.ReceivesSynapticInputsOverSDRAM

Bases: 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
abstract property 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

abstract sdram_requirement(sdram_machine_edge: SDRAMMachineEdge) int[source]

Asks a machine vertex for the SDRAM requirement it needs.

Parameters:

sdram_machine_edge (SDRAMMachineEdge) – The SDRAM edge in question

Returns:

The size in bytes this vertex needs for the SDRAM edge.

Return type:

int (most likely a multiple of 4)

abstract property 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.SendsSynapticInputsOverSDRAM

Bases: AbstractSupportsSDRAMEdges

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

abstract sdram_requirement(sdram_machine_edge: SDRAMMachineEdge) int[source]

Asks a machine vertex for the SDRAM requirement it needs.

Parameters:

sdram_machine_edge (SDRAMMachineEdge) – The SDRAM edge in question

Returns:

The size in bytes this vertex needs for the SDRAM edge.

Return type:

int (most likely a multiple of 4)

class spynnaker.pyNN.models.abstract_models.SupportsStructure

Bases: object

Indicates an object that supports the setting of a PyNN structure.

abstract set_structure(structure)[source]

Set the structure of the object.

Parameters:

structure (BaseStructure) – The structure to set