spynnaker.pyNN.models.spike_source package¶
Submodules¶
spynnaker.pyNN.models.spike_source.spike_source_array_machine_vertex module¶
- class spynnaker.pyNN.models.spike_source.spike_source_array_machine_vertex.SpikeSourceArrayMachineVertex(label: str | None, vertex_slice: Slice | None = None, app_vertex: ReverseIpTagMultiCastSource | None = None, n_keys: int | None = None, eieio_params: EIEIOParameters | None = None, send_buffer_times: _SendBufferTimes = None)[source]¶
Bases:
ReverseIPTagMulticastSourceMachineVertex
Extended to add colour.
- Parameters:
label (str or None) – The optional name of the vertex
app_vertex (ApplicationVertex or None) – The application vertex that caused this machine vertex to be created. If None, there is no such application vertex.
vertex_slice (Slice or None) – The slice of the application vertex that this machine vertex implements.
- Raises:
PacmanValueError – If the slice of the machine_vertex is too big
AttributeError – If a not-None app_vertex is not an ApplicationVertex
Module contents¶
- class spynnaker.pyNN.models.spike_source.SpikeSourceArray(spike_times=None)¶
Bases:
AbstractPyNNModel
- create_vertex(n_neurons, label, splitter, n_colour_bits)[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
splitter (AbstractSplitterCommon or None) –
n_colour_bits (int) –
- Returns:
An application vertex for the population
- Return type:
- default_population_parameters = {'n_colour_bits': None, 'splitter': None}¶
- class spynnaker.pyNN.models.spike_source.SpikeSourceArrayVertex(n_neurons, spike_times, label, max_atoms_per_core, model, splitter, n_colour_bits)¶
Bases:
ReverseIpTagMultiCastSource
,PopulationApplicationVertex
,SupportsStructure
Model for play back of spikes.
- 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.
- create_machine_vertex(vertex_slice, sdram, label=None)[source]¶
Create a machine vertex from this application vertex.
- Parameters:
vertex_slice (Slice) – The slice of atoms that the machine vertex will cover.
sdram (AbstractSDRAM) – The SDRAM used by the machine vertex.
label (str or None) – human readable label for the machine vertex
- Returns:
The created machine vertex
- Return type:
- 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.
- 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.
- 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.
- get_parameter_values(names, selector=None)[source]¶
Get the values of a parameter or parameters for the whole Population or a subset if the selector is used.
- Parameters:
- Return type:
- Raises:
KeyError – if the parameter is not something that can be read
- 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.
- 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()
- property n_colour_bits¶
The number of colour bits sent by this vertex.
Assumed 0 unless overridden
- Return type:
- set_parameter_values(name, value, selector=None)[source]¶
Set the values of a parameter for the whole Population or a subset if the selector is used.
- class spynnaker.pyNN.models.spike_source.SpikeSourceFromFile(spike_time_file, min_atom=None, max_atom=None, min_time=None, max_time=None, split_value='\t')¶
Bases:
SpikeSourceArray
A spike source that works from a file (typically a tab-separated table in a text file).
- property spike_times¶
- class spynnaker.pyNN.models.spike_source.SpikeSourcePoisson(rate=1.0, start=0, duration=None)¶
Bases:
AbstractPyNNModel
- absolute_max_atoms_per_core = 500¶
- create_vertex(n_neurons, label, seed, max_rate, splitter, n_colour_bits)[source]¶
Create a vertex for a population of the model.
- Parameters:
- Returns:
An application vertex for the population
- Return type:
- default_population_parameters = {'max_rate': None, 'n_colour_bits': None, 'seed': None, 'splitter': None}¶
- class spynnaker.pyNN.models.spike_source.SpikeSourcePoissonMachineVertex(sdram, is_recording, label=None, app_vertex=None, vertex_slice=None)¶
Bases:
MachineVertex
,AbstractReceiveBuffersToHost
,ProvidesProvenanceDataFromMachineImpl
,AbstractHasProfileData
,AbstractHasAssociatedBinary
,AbstractRewritesDataSpecification
,AbstractGeneratesDataSpecification
,SendsSynapticInputsOverSDRAM
- Parameters:
label (str or None) – The optional name of the vertex
app_vertex (ApplicationVertex or None) – The application vertex that caused this machine vertex to be created. If None, there is no such application vertex.
vertex_slice (Slice or None) – The slice of the application vertex that this machine vertex implements.
- Raises:
PacmanValueError – If the slice of the machine_vertex is too big
AttributeError – If a not-None app_vertex is not an ApplicationVertex
- FAST_RATE_PER_TICK_CUTOFF = 10¶
- class POISSON_SPIKE_SOURCE_REGIONS(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
IntEnum
Memory region IDs for the the Poisson source code.
- EXPANDER_REGION = 7¶
Data for the on-chip connection generator binaries.
- POISSON_PARAMS_REGION = 1¶
The parameters for the Poisson generator.
- PROFILER_REGION = 5¶
Profiler data.
- PROVENANCE_REGION = 4¶
Provenance data.
- RATES_REGION = 2¶
Spike rates (and the times at which they apply).
- SDRAM_EDGE_PARAMS = 6¶
Parameters for an SDRAM edge.
- SPIKE_HISTORY_REGION = 3¶
Record of when spikes were actually sent.
- SYSTEM_REGION = 0¶
System control information (simulation timestep, etc.)
- PROFILE_TAG_LABELS = {0: 'TIMER', 1: 'PROB_FUNC'}¶
- SEED_OFFSET_BYTES = 44¶
- SEED_SIZE_BYTES = 16¶
- SLOW_RATE_PER_TICK_CUTOFF = 0.01¶
- generate_data_specification(spec, placement)[source]¶
Generate a data specification.
- Parameters:
spec (DataSpecificationGenerator) – The data specification to write to
placement (Placement) – The placement the vertex is located at
- get_binary_start_type()[source]¶
Get the start type of the binary to be run.
- Return type:
ExecutableType
- get_n_keys_for_partition(partition_id)[source]¶
Get the number of keys required by the given partition of edges.
- get_profile_data(placement)[source]¶
Get the profile data recorded during simulation.
- Parameters:
placement (Placement) –
- Return type:
- get_recorded_region_ids()[source]¶
Get the recording region IDs that have been recorded using buffering.
- Returns:
The region numbers that have active recording
- Return type:
iterable(int)
- regenerate_data_specification(spec, placement)[source]¶
Regenerate the data specification, only generating regions that have changed and need to be reloaded.
- Parameters:
spec (DataSpecificationGenerator) – Where to write the regenerated spec
placement (Placement) – Where are we regenerating for?
- property sdram_required¶
The SDRAM space required by the vertex.
- Return type:
- sdram_requirement(sdram_machine_edge)[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.spike_source.SpikeSourcePoissonVariable(rates, starts, durations=None)¶
Bases:
AbstractPyNNModel
- absolute_max_atoms_per_core = 500¶
- create_vertex(n_neurons, label, seed, 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
seed (float) –
splitter (AbstractSplitterCommon or None) –
- Returns:
An application vertex for the population
- Return type:
- default_population_parameters = {'seed': None, 'splitter': None}¶
- class spynnaker.pyNN.models.spike_source.SpikeSourcePoissonVertex(n_neurons, label, seed, max_atoms_per_core, model, rate=None, start=None, duration=None, rates=None, starts=None, durations=None, max_rate=None, splitter=None, n_colour_bits=None)¶
Bases:
PopulationApplicationVertex
,LegacyPartitionerAPI
,SupportsStructure
A Poisson Spike source object.
- Parameters:
n_neurons (int) –
label (str) –
seed (float) –
max_atoms_per_core (int) –
model (SpikeSourcePoisson) –
rate (float) –
start (int) –
duration (int) –
rates (iterable(float)) –
starts (iterable(int)) –
durations (iterable(int)) –
max_rate (float) –
splitter (AbstractSplitterCommon or None) –
n_colour_bits (int) –
- SPIKE_RECORDING_REGION_ID = 0¶
- add_outgoing_projection(projection)[source]¶
Add an outgoing projection from this vertex.
- Parameters:
projection (Projection) – The projection to add
- 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.
- create_machine_vertex(vertex_slice, sdram, label=None)[source]¶
Create a machine vertex from this application vertex.
- Parameters:
vertex_slice (Slice) – The slice of atoms that the machine vertex will cover.
sdram (AbstractSDRAM) – The SDRAM used by the machine vertex.
label (str or None) – human readable label for the machine vertex
- Returns:
The created machine vertex
- Return type:
- property data¶
- describe()[source]¶
Return 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.
- 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.
- 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.
- get_parameter_values(names, selector=None)[source]¶
Get the values of a parameter or parameters for the whole Population or a subset if the selector is used.
- Parameters:
- Return type:
- Raises:
KeyError – if the parameter is not something that can be read
- 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.
- 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()
- get_sdram_used_by_atoms(vertex_slice)[source]¶
Get the separate SDRAM requirements for a range of atoms.
- Parameters:
vertex_slice (Slice) – the low value of atoms to calculate resources from
vertex_slice –
- Return type:
- property incoming_control_edge¶
- property max_n_rates¶
- property max_rate¶
- property n_colour_bits¶
The number of colour bits sent by this vertex.
Assumed 0 unless overridden
- Return type:
- property n_profile_samples¶
- property outgoing_projections¶
The projections outgoing from this vertex.
- Return type:
- property rates¶
Get the rates.
- Return type:
- property seed¶
- set_parameter_values(name, value, selector=None)[source]¶
Set the values of a parameter for the whole Population or a subset if the selector is used.
- set_recording(name, sampling_interval=None, indices=None)[source]¶
Set a variable recording.
- Parameters:
- 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
- property time_to_spike¶