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: int, label: str, port: int | None, virtual_key: int | None, reserve_reverse_ip_tag: bool, splitter: AbstractSplitterCommon | None, max_atoms_per_core: int | Tuple[int, ...] | None = 9223372036854775807)[source]¶
Bases:
ReverseIpTagMultiCastSource,PopulationApplicationVertex,SupportsStructureAn Injector of Spikes for PyNN populations. This only allows the user to specify the virtual_key of the population to identify the population.
- Parameters:
label – The optional name of the vertex.
- SPIKE_RECORDING_REGION_ID = 0¶
- property atoms_shape: Tuple[int, ...]¶
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.
- default_parameters = {'label': 'spikeInjector', 'port': None, 'virtual_key': None}¶
- describe() Dict[str, str | Collection[str]][source]¶
- Returns:
A human-readable description of the cell or synapse type.
- get_buffer_data_type(name: str) BufferDataType[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 – The name of the variable recorded
- Raises:
KeyError – if the variable isn’t being recorded
- Returns:
Data type in the Buffer Database
- get_data_type(name: str) None[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 – The name of the variable to get the type of
- Returns:
The data type used by the C code
- Raises:
KeyError – If the variable isn’t recordable
- get_neurons_recording(name: str, vertex_slice: Slice) ndarray[tuple[Any, ...], dtype[integer]][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 – The name of the variable to get the region of
vertex_slice
- Returns:
A list of the global raster IDs of the atoms in recording named variable within this slice
- get_recordable_variables() List[str][source]¶
Get a list of the names of things that can be recorded.
This methods list the variable recorded via the Population.
Includes both neuron and synapse recordable things
- Returns:
List of variable names
- get_recording_region(name: str) int[source]¶
- Parameters:
name – The name of the variable to get the region of
- Returns:
The recording region for the named variable.
- Raises:
KeyError – If the variable isn’t being recorded
- get_recording_variables() List[str][source]¶
- Returns:
A list of variables that are currently being recorded.
- get_sampling_interval_ms(name: str) float[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()
- Parameters:
name – The name of the variable
- Returns:
Sampling rate in milliseconds for this variable
- Raises:
KeyError – If the variable isn’t being recorded
- get_units(name: str) str[source]¶
Get the units of the given parameter or state variable.
- Parameters:
name – the name of the parameter to get the units of
- Returns:
The unit or this variable. For example ‘mV’ or ‘uS’. Will be an empty string for things like spikes and probability
- Raises:
KeyError – if the name isn’t recognised or the units cannot be identified
- set_not_recording(name: str, indices: Collection[int] | None = None) None[source]¶
Set a variable not recording.
- Parameters:
name – The name of the variable to not record
indices – 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: str, sampling_interval: float | None = None, indices: Collection[int] | None = None) None[source]¶
Set a variable recording.
- Parameters:
name – The name of the variable to set the status of
sampling_interval – How often the variable should be recorded or None for every time step, in milliseconds
indices – The list of neuron indices to record or None for all
- Raises:
KeyError – if the variable cannot be recorded
- set_structure(structure: BaseStructure) None[source]¶
Set the structure of the object.
- Parameters:
structure – The structure to set
Module contents¶
- class spynnaker.pyNN.models.utility_models.spike_injector.SpikeInjector(*args: Any, **kwargs: Any)¶
Bases:
AbstractPyNNModelModel that creates a Spike Injector Vertex
- create_vertex(n_neurons: int, label: str, *, port: int | None = None, virtual_key: int | None = None, reserve_reverse_ip_tag: bool = False, splitter: AbstractSplitterCommon | None = None) SpikeInjectorVertex[source]¶
Create a vertex for a population of the model.
- Parameters:
n_neurons – The number of neurons in the population
label – The label to give to the vertex
port
virtual_key
reserve_reverse_ip_tag
splitter
- Returns:
An application vertex for the population
- default_population_parameters: Dict[str, Any] = {'port': None, 'reserve_reverse_ip_tag': False, 'splitter': None, 'virtual_key': None}¶
The default values for the parameters at the population level. These are parameters that can be passed in to the Population constructor in addition to the standard PyNN options.