spynnaker.pyNN package

Subpackages

Submodules

spynnaker.pyNN.abstract_spinnaker_common module

class spynnaker.pyNN.abstract_spinnaker_common.AbstractSpiNNakerCommon(graph_label, database_socket_addresses, n_chips_required, n_boards_required, timestep, max_delay, min_delay, hostname, user_extra_algorithm_xml_path=None, user_extra_mapping_inputs=None, user_extra_algorithms_pre_run=None, time_scale_factor=None, extra_post_run_algorithms=None, extra_mapping_algorithms=None, extra_load_algorithms=None, front_end_versions=None)[source]

Bases: spinn_front_end_common.interface.abstract_spinnaker_base.AbstractSpinnakerBase

Main interface for neural code.

Parameters:
add_application_vertex(vertex)[source]
Parameters:

vertex (ApplicationVertex) – the vertex to add to the graph

Raises:
add_population(population)[source]

Called by each population to add itself to the list.

add_projection(projection)[source]

Called by each projection to add itself to the list.

classmethod extended_config_path()[source]
get_projections_data(projection_to_attribute_map)[source]
Common data extractor for projection data. Allows fully
exploitation of the ????
Parameters:projection_to_attribute_map (dict(Projection, list(int) or tuple(int) or None)) – the projection to attributes mapping
Returns:a extracted data object with get method for getting the data
Return type:ExtractedData
id_counter

The id_counter, currently used by the populations.

Note

Maybe it could live in the pop class???

Return type:int
min_delay

The minimum supported delay, in milliseconds.

static register_binary_search_path(search_path)[source]

Register an additional binary search path for executables.

Parameters:search_path (str) – absolute search path for binaries
Return type:None
reset_number_of_neurons_per_core()[source]
run(run_time, sync_time=0.0)[source]

Run the model created.

Parameters:
  • run_time (float or int) – the time (in milliseconds) to run the simulation for
  • sync_time (float) – If not 0, this specifies that the simulation should pause after this duration. The continue_simulation() method must then be called for the simulation to continue.
Return type:

None

set_number_of_neurons_per_core(neuron_type, max_permitted)[source]
stop(turn_off_machine=None, clear_routing_tables=None, clear_tags=None)[source]
Parameters:
  • turn_off_machine (bool or None) – decides if the machine should be powered down after running the execution. Note that this powers down all boards connected to the BMP connections given to the transceiver
  • clear_routing_tables (bool or None) – informs the tool chain if it should turn off the clearing of the routing tables
  • clear_tags (bool or None) – informs the tool chain if it should clear the tags off the machine at stop
Return type:

None

spynnaker.pyNN.exceptions module

exception spynnaker.pyNN.exceptions.DelayExtensionException[source]

Bases: spinn_front_end_common.utilities.exceptions.ConfigurationException

Raised when a delay extension vertex fails.

exception spynnaker.pyNN.exceptions.FilterableException[source]

Bases: spynnaker.pyNN.exceptions.SpynnakerException

Raised when it is not possible to determine if an edge should be filtered.

exception spynnaker.pyNN.exceptions.InvalidParameterType[source]

Bases: spynnaker.pyNN.exceptions.SpynnakerException

Raised when a parameter is not recognised.

exception spynnaker.pyNN.exceptions.MemReadException[source]

Bases: spynnaker.pyNN.exceptions.SpynnakerException

Raised when the PyNN front end fails to read a certain memory region.

exception spynnaker.pyNN.exceptions.SpynnakerException[source]

Bases: Exception

Superclass of all exceptions from the PyNN module.

exception spynnaker.pyNN.exceptions.SpynnakerSplitterConfigurationException[source]

Bases: spinn_front_end_common.utilities.exceptions.ConfigurationException

Raised when a splitter configuration fails.

exception spynnaker.pyNN.exceptions.SynapseRowTooBigException(max_size, message)[source]

Bases: spynnaker.pyNN.exceptions.SpynnakerException

Raised when a synapse row is bigger than is allowed.

Parameters:
  • max_size – the maximum permitted size of row
  • message – the excepton message
max_size

The maximum size allowed.

exception spynnaker.pyNN.exceptions.SynapticBlockGenerationException[source]

Bases: spinn_front_end_common.utilities.exceptions.ConfigurationException

Raised when the synaptic manager fails to generate a synaptic block.

exception spynnaker.pyNN.exceptions.SynapticBlockReadException[source]

Bases: spinn_front_end_common.utilities.exceptions.ConfigurationException

Raised when the synaptic manager fails to read a synaptic block or convert it into readable values.

exception spynnaker.pyNN.exceptions.SynapticConfigurationException[source]

Bases: spinn_front_end_common.utilities.exceptions.ConfigurationException

Raised when the synaptic manager fails for some reason.

exception spynnaker.pyNN.exceptions.SynapticMaxIncomingAtomsSupportException[source]

Bases: spinn_front_end_common.utilities.exceptions.ConfigurationException

Raised when a synaptic sublist exceeds the max atoms possible to be supported.

spynnaker.pyNN.spynnaker_external_device_plugin_manager module

class spynnaker.pyNN.spynnaker_external_device_plugin_manager.SpynnakerExternalDevicePluginManager[source]

Bases: object

User-level interface for the external device plugin manager.

static activate_live_output_for(population, database_notify_host=None, database_notify_port_num=None, database_ack_port_num=None, board_address=None, port=None, host=None, tag=None, strip_sdp=True, use_prefix=False, key_prefix=None, prefix_type=None, message_type=<EIEIOType.KEY_32_BIT: 2>, right_shift=0, payload_as_time_stamps=True, notify=True, use_payload_prefix=True, payload_prefix=None, payload_right_shift=0, number_of_packets_sent_per_time_step=0)[source]

Output the spikes from a given population from SpiNNaker as they occur in the simulation.

Parameters:
  • population (Population) – The population to activate the live output for
  • database_notify_host (str) – The hostname for the device which is listening to the database notification.
  • database_ack_port_num (int) – The port number to which a external device will acknowledge that they have finished reading the database and are ready for it to start execution
  • database_notify_port_num (int) – The port number to which a external device will receive the database is ready command
  • board_address (str) – A fixed board address required for the tag, or None if any address is OK
  • key_prefix (int or None) – the prefix to be applied to the key
  • prefix_type (EIEIOPrefix) – if the prefix type is 32 bit or 16 bit
  • message_type (EIEIOType) – If the message is a EIEIO command message, or an EIEIO data message with 16 bit or 32 bit keys.
  • payload_as_time_stamps (bool) –
  • right_shift (int) –
  • use_payload_prefix (bool) –
  • notify (bool) –
  • payload_prefix (int or None) –
  • payload_right_shift (int) –
  • number_of_packets_sent_per_time_step (int) –
  • port (int) – The UDP port to which the live spikes will be sent. If not specified, the port will be taken from the “live_spike_port” parameter in the “Recording” section of the sPyNNaker configuration file.
  • host (str) – The host name or IP address to which the live spikes will be sent. If not specified, the host will be taken from the “live_spike_host” parameter in the “Recording” section of the sPyNNaker configuration file.
  • tag (int) – The IP tag to be used for the spikes. If not specified, one will be automatically assigned
  • strip_sdp (bool) – Determines if the SDP headers will be stripped from the transmitted packet.
  • use_prefix (bool) – Determines if the spike packet will contain a common prefix for the spikes
  • label (str) – The label of the gatherer vertex
  • partition_ids (list(str)) – The names of the partitions to create edges for
static activate_live_output_to(population, device, partition_id='SPIKE')[source]

Activate the output of spikes from a population to an external device. Note that all spikes will be sent to the device.

Parameters:
  • population (Population) – The pyNN population object from which spikes will be sent.
  • device (Population or ApplicationVertex) – The pyNN population or external device to which the spikes will be sent.
  • partition_id (str) – The partition ID to activate live output to.
static add_application_vertex(vertex)[source]
static add_database_socket_address(database_notify_host, database_notify_port_num, database_ack_port_num)[source]
Parameters:
  • database_notify_host (str or None) – Host to talk to tell that the database (and application) is ready.
  • database_notify_port_num (int or None) – Port to talk to tell that the database (and application) is ready.
  • database_ack_port_num (int or None) – Port on which to listen for an acknowledgement that the simulation should start.
static add_edge(vertex, device_vertex, partition_id)[source]

Add an edge between two vertices (often a vertex and a external device) on a given partition.

Parameters:
  • vertex (ApplicationVertex) – the pre-vertex to connect the edge from
  • device_vertex (ApplicationVertex) – the post vertex to connect the edge to
  • partition_id (str) – the partition identifier for making nets
static add_poisson_live_rate_control(poisson_population, control_label_extension='_control', receive_port=None, database_notify_host=None, database_notify_port_num=None, database_ack_port_num=None, notify=True, reserve_reverse_ip_tag=False)[source]

Add a live rate controller to a Poisson population.

Parameters:
  • poisson_population (Population) – The population to control
  • control_label_extension (str) – An extension to add to the label of the Poisson source. Must match up with the equivalent in the SpynnakerPoissonControlConnection
  • receive_port (int) – The port that the SpiNNaker board should listen on
  • database_notify_host (str) – the hostname for the device which is listening to the database notification.
  • database_ack_port_num (int) – the port number to which a external device will acknowledge that they have finished reading the database and are ready for it to start execution
  • database_notify_port_num (int) – The port number to which an external device will receive the database is ready command
  • notify (bool) – adds to the notification protocol if set.
  • reserve_reverse_ip_tag (bool) – True if a reverse IP tag is to be used, False if SDP is to be used (default)
static add_socket_address(socket_address)[source]

Add a socket address to the list to be checked by the notification protocol.

Parameters:socket_address (SocketAddress) – the socket address
static update_live_packet_gather_tracker(vertex_to_record_from, lpg_label, port=None, hostname=None, board_address=None, tag=None, strip_sdp=True, use_prefix=False, key_prefix=None, prefix_type=None, message_type=<EIEIOType.KEY_32_BIT: 2>, right_shift=0, payload_as_time_stamps=True, use_payload_prefix=True, payload_prefix=None, payload_right_shift=0, number_of_packets_sent_per_time_step=0, partition_ids=None)[source]

Add an edge from a vertex to the live packet gatherer, builds as needed and has all the parameters for the creation of the live packet gatherer if needed.

Parameters:

Module contents