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

Clear the connection data stored in the vertex so far.

abstract get_connections_from_machine(app_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation) ConnectionsArray[source]

Get the connections from the machine post-run.

Parameters:
Return type:

ndarray

abstract get_synapse_id_by_target(target: str) int | None[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: AbstractSynapseDynamics)[source]

Set the synapse dynamics of this vertex.

Parameters:

synapse_dynamics (AbstractSynapseDynamics)

verify_splitter(splitter: AbstractSpynnakerSplitterDelay)[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: int

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

Get maximum expected number of spikes per second.

abstract max_spikes_per_ts() float[source]

Get maximum expected number of spikes per timestep.

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() bool[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: int

The region containing the parameters of neuron expansion.

Return type:

int

abstract read_generated_initial_values(placement: 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: int

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: int

The region ID containing the parameters of synaptic expansion.

Return type:

int

abstract gen_on_machine() bool[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: int

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: 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: Slice) List[Tuple[int, int, int, int]][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

API for getting connections from the machine.

abstract get_connections_from_machine(placement: Placement, app_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation) Sequence[NDArray][source]

Get the connections from the machine for this vertex.

Parameters:
Return type:

list(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: int

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 property weight_scales: ndarray[Any, dtype[floating]]

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.

class spynnaker.pyNN.models.abstract_models.SupportsStructure

Bases: object

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

abstract set_structure(structure: BaseStructure)[source]

Set the structure of the object.

Parameters:

structure (BaseStructure) – The structure to set