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, 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, spynnaker.pyNN.spynnaker_simulator_interface.SpynnakerSimulatorInterface

Main interface for neural code.

CONFIG_FILE_NAME = 'spynnaker.cfg'
add_application_vertex(vertex_to_add)[source]
Parameters:

vertex – the vertex to add to the graph

Type:

ApplicationVertex

Return type:

None

Raises:
  • ConfigurationException – when both graphs contain vertices
  • PacmanConfigurationException – If there is an attempt to add the same vertex more than once
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.

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 of projection with set of attributes) – the projection to attributes mapping
Returns:a extracted data object with get method for getting the data
Return type:spynnaker.pyNN.utilities.extracted_data.ExtractedData
id_counter

Getter for id_counter, currently used by the populations.

Note

Maybe it could live in the pop class???

Returns:
Return type:int
max_delay

The maximum supported delay, in milliseconds.

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 – absolute search path for binaries
reset_number_of_neurons_per_core()[source]
run(run_time)[source]

Run the model created.

Parameters:run_time – the time (in milliseconds) to run the simulation for
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) – 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) – informs the tool chain if it should turn off the clearing of the routing tables
  • clear_tags (boolean) – informs the tool chain if it should clear the tags off the machine at stop
Return type:

None

time_scale_factor

The multiplicative scaling from application time to real execution time.

Returns:the time scale factor

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.SynapseRowTooBigException(max_size, message)[source]

Bases: spynnaker.pyNN.exceptions.SpynnakerException

Raised when a synapse row is bigger than is allowed.PyNN

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 (spynnaker.pyNN.models.pynn_population_common.PyNNPopulationCommon) – 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 – if the prefix type is 32 bit or 16 bit
  • message_type – If the message is a EIEIO command message, or an EIEIO data message with 16 bit or 32 bit keys.
  • payload_as_time_stamps
  • right_shift
  • use_payload_prefix
  • notify
  • payload_prefix
  • payload_right_shift
  • number_of_packets_sent_per_time_step
  • 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
static activate_live_output_to(population, device)[source]

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

Parameters:
static add_application_vertex(vertex)[source]
static add_database_socket_address(database_notify_host, database_notify_port_num, database_ack_port_num)[source]
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 – the pre vertex to connect the edge from
  • device_vertex – the post vertex to connect the edge to
  • partition_id – the partition identifier for making nets
Return type:

None

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 (spynnaker.pyNN.models.pynn_population_common.PyNNPopulationCommon) – 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 a external device will receive the database is ready command
  • 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 – the socket address
Return type:None:
static machine_time_step()[source]
static time_scale_factor()[source]
static update_live_packet_gather_tracker(vertex_to_record_from, port, hostname, tag=None, board_address=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_id=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.

spynnaker.pyNN.spynnaker_simulator_interface module

class spynnaker.pyNN.spynnaker_simulator_interface.SpynnakerSimulatorInterface[source]

Bases: spinn_front_end_common.utilities.simulator_interface.SimulatorInterface

get_current_time()[source]
get_distribution_to_stats()[source]
get_pynn_NumpyRNG()[source]
get_random_distribution()[source]
has_reset_last
is_a_pynn_random(thing)[source]
max_delay
min_delay
reset(annotations=None)[source]
set_number_of_neurons_per_core(neuron_type, max_permitted)[source]

Module contents