spynnaker.pyNN.models.utility_models.spike_injector package

Submodules

spynnaker.pyNN.models.utility_models.spike_injector.spike_injector_vertex module

class spynnaker.pyNN.models.utility_models.spike_injector.spike_injector_vertex.SpikeInjectorVertex(n_neurons, label, port, virtual_key, reserve_reverse_ip_tag, splitter)[source]

Bases: ReverseIpTagMultiCastSource, PopulationApplicationVertex, SupportsStructure

An Injector of Spikes for PyNN populations. This only allows the user to specify the virtual_key of the population to identify the population.

Parameters:
  • n_keys (int) – The number of keys to be sent via this multicast source

  • label (str) – The label of this vertex

  • max_atoms_per_core (int) –

  • board_address (str or None) – The IP address of the board on which to place this vertex if receiving data, either buffered or live (by default, any board is chosen)

  • receive_port (int or None) – The port on the board that will listen for incoming event packets (default is to disable this feature; set a value to enable it)

  • receive_sdp_port (int) – The SDP port to listen on for incoming event packets (defaults to 1)

  • receive_tag (IPTag) – The IP tag to use for receiving live events (uses any by default)

  • receive_rate (float) – The estimated rate of packets that will be sent by this source

  • virtual_key (int) – The base multicast key to send received events with (assigned automatically by default)

  • prefix (int) – The prefix to “or” with generated multicast keys (default is no prefix)

  • prefix_type (EIEIOPrefix) – Whether the prefix should apply to the upper or lower half of the multicast keys (default is upper half)

  • check_keys (bool) – True if the keys of received events should be verified before sending (default False)

  • send_buffer_times (ndarray(ndarray(numpy.int32)) or list(ndarray(int32)) or None) – An array of arrays of times at which keys should be sent (one array for each key, default disabled)

  • send_buffer_partition_id (str or None) – The ID of the partition containing the edges down which the events are to be sent

  • reserve_reverse_ip_tag (bool) – Extra flag for input without a reserved port

  • injection_partition (str) – If not None, will enable injection and specify the partition to send injected keys with

  • splitter (AbstractSplitterCommon or None) – the splitter object needed for this vertex

SPIKE_RECORDING_REGION_ID = 0
property atoms_shape

The “shape” of the atoms in the vertex i.e. how the atoms are split between the dimensions of the vertex. By default everything is 1-dimensional, so the value will be a 1-tuple but can be overridden by a vertex that supports multiple dimensions.

Return type:

tuple(int, …)

default_parameters = {'label': 'spikeInjector', 'port': None, 'virtual_key': None}
describe()[source]

Returns a human-readable description of the cell or synapse type.

The output may be customised by specifying a different template together with an associated template engine (see pyNN.descriptions).

If template is None, then a dictionary containing the template context will be returned.

get_buffer_data_type(name)[source]

Get the type of data recorded by the buffer manager.

The buffer data type controls how data returned by the cores is handled in NeoBufferDatabase.

Parameters:

name (str) – The name of the variable recorded

Return type:

BufferDatabase

Raises:

KeyError – if the variable isn’t being recorded

get_data_type(name)[source]

Get the type data returned by a recording of the variable.

This is the type of data the C code is returning. For instance data such as spikes this will be None.

Parameters:

name (str) – The name of the variable to get the type of

Return type:

DataType or None

Raises:

KeyError – If the variable isn’t recordable

get_neurons_recording(name, vertex_slice)[source]

Gets the neurons being recorded on the core with this slice.

Typically vertex_slice.get_raster_ids(atoms_shape) but may be a sublist if doing selective recording.

Parameters:
  • name (str) – The name of the variable to get the region of

  • vertex_slice (Slice) –

Returns:

A list of the global raster IDs of the atoms in recording named variable within this slice

Return type:

list(int)

get_recordable_variables()[source]

Get a list of the names and types of things that can be recorded.

This methods list the variable recorded via the Population.

Return type:

list(str)

get_recording_region(name)[source]

Gets the recording region for the named variable.

Parameters:

name (str) – The name of the variable to get the region of

Return type:

int

Raises:

KeyError – If the variable isn’t being recorded

get_recording_variables()[source]

Get a list of variables that are currently being recorded.

Return type:

list(str)

get_sampling_interval_ms(name)[source]

Get the sampling interval of the recording for the given variable.

The values is in ms and unless selective recording is used will be SpynnakerDataView.get_simulation_time_step_us()

Return type:

float

Raises:

KeyError – If the variable isn’t being recorded

get_units(name)[source]

Get the units of the given parameter or state variable.

Parameters:

name (str) – the name of the parameter to get the units of

Return type:

str

Raises:

KeyError – if the name isn’t recognised or the units cannot be identified

set_not_recording(name, indices=None)[source]

Set a variable not recording.

Parameters:
  • name (str) – The name of the variable to not record

  • indices (list(int) or None) – The list of neuron indices to not record or None for all

Raises:

KeyError – if the variable cannot be stopped from recording

set_recording(name, sampling_interval=None, indices=None)[source]

Set a variable recording.

Parameters:
  • name (str) – The name of the variable to set the status of

  • sampling_interval (float or None) – How often the variable should be recorded or None for every time step, in milliseconds

  • indices (list(int) or None) – The list of neuron indices to record or None for all

Raises:

KeyError – if the variable cannot be recorded

set_structure(structure)[source]

Set the structure of the object.

Parameters:

structure (BaseStructure) – The structure to set

Module contents

class spynnaker.pyNN.models.utility_models.spike_injector.SpikeInjector

Bases: AbstractPyNNModel

create_vertex(n_neurons, label, port, virtual_key, reserve_reverse_ip_tag, splitter)[source]

Create a vertex for a population of the model.

Parameters:
  • n_neurons (int) – The number of neurons in the population

  • label (str) – The label to give to the vertex

  • port (int) –

  • virtual_key (int) –

  • reserve_reverse_ip_tag (bool) –

  • splitter (AbstractSplitterCommon or None) –

Returns:

An application vertex for the population

Return type:

PopulationApplicationVertex

default_population_parameters = {'port': None, 'reserve_reverse_ip_tag': False, 'splitter': None, 'virtual_key': None}