spynnaker.pyNN.models.spike_source package¶
Submodules¶
spynnaker.pyNN.models.spike_source.spike_source_array module¶
-
class
spynnaker.pyNN.models.spike_source.spike_source_array.
SpikeSourceArray
(spike_times=[])[source]¶ Bases:
spynnaker.pyNN.models.abstract_pynn_model.AbstractPyNNModel
-
create_vertex
(n_neurons, label, constraints)[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
- constraints (list or None) – A list of constraints to give to the vertex, or None
Returns: An application vertex for the population
Return type:
-
default_population_parameters
= {}¶
-
spynnaker.pyNN.models.spike_source.spike_source_array_vertex module¶
-
class
spynnaker.pyNN.models.spike_source.spike_source_array_vertex.
SpikeSourceArrayVertex
(n_neurons, spike_times, constraints, label, max_atoms_per_core, model)[source]¶ Bases:
spinn_front_end_common.utility_models.reverse_ip_tag_multi_cast_source.ReverseIpTagMultiCastSource
,spynnaker.pyNN.models.common.abstract_spike_recordable.AbstractSpikeRecordable
,spynnaker.pyNN.models.common.simple_population_settable.SimplePopulationSettable
,spinn_front_end_common.abstract_models.abstract_changable_after_run.AbstractChangableAfterRun
,spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl
Model for play back of spikes
-
SPIKE_RECORDING_REGION_ID
= 0¶
-
clear_spike_recording
(buffer_manager, placements, graph_mapper)[source]¶ Clear the recorded data from the object
Parameters: - buffer_manager – the buffer manager object
- placements – the placements object
- graph_mapper – the graph mapper object
Return type: 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_spikes
(placements, graph_mapper, buffer_manager, machine_time_step)[source]¶ Get the recorded spikes from the object
Parameters: - placements – the placements object
- graph_mapper – the graph mapper object
- buffer_manager – the buffer manager object
- machine_time_step – the time step of the simulation
Returns: A numpy array of 2-element arrays of (neuron_id, time) ordered by time
-
get_spikes_sampling_interval
()[source]¶ Return the current sampling interval for spikes
Returns: Sampling interval in micro seconds
-
is_recording_spikes
()[source]¶ Determine if spikes are being recorded
Returns: True if spikes are being recorded, False otherwise Return type: bool
-
mark_no_changes
()[source]¶ Marks the point after which changes are reported, so that new changes can be detected before the next check.
-
requires_mapping
¶ True if changes that have been made require that mapping be performed. By default this returns False but can be overridden to indicate changes that require mapping.
Return type: bool
-
set_recording_spikes
(new_state=True, sampling_interval=None, indexes=None)[source]¶ Set spikes to being recorded. If new_state is false all other parameters are ignored.
Parameters: - new_state (bool) – Set if the spikes are recording or not
- sampling_interval – The interval at which spikes are recorded. Must be a whole multiple of the timestep None will be taken as the timestep
- indexes – The indexes of the neurons that will record spikes. If None the assumption is all neurons are recording
-
spike_times
¶ The spike times of the spike source array
-
spynnaker.pyNN.models.spike_source.spike_source_from_file module¶
-
class
spynnaker.pyNN.models.spike_source.spike_source_from_file.
SpikeSourceFromFile
(spike_time_file, min_atom=None, max_atom=None, min_time=None, max_time=None, split_value='t')[source]¶ Bases:
spynnaker.pyNN.models.spike_source.spike_source_array.SpikeSourceArray
SpikeSourceArray that works from a file
-
spike_times
¶
-
spynnaker.pyNN.models.spike_source.spike_source_poisson module¶
-
class
spynnaker.pyNN.models.spike_source.spike_source_poisson.
SpikeSourcePoisson
(rate=1.0, start=0, duration=None)[source]¶ Bases:
spynnaker.pyNN.models.abstract_pynn_model.AbstractPyNNModel
-
create_vertex
(n_neurons, label, constraints, seed, max_rate)[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
- constraints (list or None) – A list of constraints to give to the vertex, or None
Returns: An application vertex for the population
Return type:
-
default_population_parameters
= {'max_rate': None, 'seed': None}¶
-
spynnaker.pyNN.models.spike_source.spike_source_poisson_machine_vertex module¶
-
class
spynnaker.pyNN.models.spike_source.spike_source_poisson_machine_vertex.
SpikeSourcePoissonMachineVertex
(resources_required, is_recording, constraints=None, label=None)[source]¶ Bases:
pacman.model.graphs.machine.machine_vertex.MachineVertex
,spinn_front_end_common.interface.buffer_management.buffer_models.abstract_receive_buffers_to_host.AbstractReceiveBuffersToHost
,spinn_front_end_common.interface.provenance.provides_provenance_data_from_machine_impl.ProvidesProvenanceDataFromMachineImpl
,spinn_front_end_common.abstract_models.abstract_recordable.AbstractRecordable
,spinn_front_end_common.abstract_models.abstract_supports_database_injection.AbstractSupportsDatabaseInjection
,spinn_front_end_common.interface.profiling.abstract_has_profile_data.AbstractHasProfileData
-
class
POISSON_SPIKE_SOURCE_REGIONS
¶ Bases:
enum.Enum
An enumeration.
-
POISSON_PARAMS_REGION
= 1¶
-
PROFILER_REGION
= 4¶
-
PROVENANCE_REGION
= 3¶
-
SPIKE_HISTORY_REGION
= 2¶
-
SYSTEM_REGION
= 0¶
-
-
PROFILE_TAG_LABELS
= {0: 'TIMER', 1: 'PROB_FUNC'}¶
-
get_profile_data
(transceiver, placement)[source]¶ Get the profile data recorded during simulation
Return type: spinn_front_end_common.interface.profiling.profile_data.ProfileData
-
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)
-
get_recording_region_base_address
(txrx, placement)[source]¶ Get the recording region base address
Parameters: - txrx (Transceiver) – the SpiNNMan instance
- placement (Placement) – the placement object of the core to find the address of
Returns: the base address of the recording region
Return type: int
-
is_in_injection_mode
(graph)[source]¶ Whether this vertex is actually in injection mode.
Return type: bool
-
resources_required
¶ The resources required by the vertex
Return type: ResourceContainer
-
class
spynnaker.pyNN.models.spike_source.spike_source_poisson_vertex module¶
-
class
spynnaker.pyNN.models.spike_source.spike_source_poisson_vertex.
SpikeSourcePoissonVertex
(n_neurons, constraints, label, rate, max_rate, start, duration, seed, max_atoms_per_core, model)[source]¶ Bases:
pacman.model.graphs.application.application_vertex.ApplicationVertex
,spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification
,spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary
,spynnaker.pyNN.models.common.abstract_spike_recordable.AbstractSpikeRecordable
,spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints
,spinn_front_end_common.abstract_models.abstract_changable_after_run.AbstractChangableAfterRun
,spynnaker.pyNN.models.abstract_models.abstract_read_parameters_before_set.AbstractReadParametersBeforeSet
,spinn_front_end_common.abstract_models.abstract_rewrites_data_specification.AbstractRewritesDataSpecification
,spynnaker.pyNN.models.common.simple_population_settable.SimplePopulationSettable
,spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl
A Poisson Spike source object
-
SPIKE_RECORDING_REGION_ID
= 0¶
-
clear_spike_recording
(buffer_manager, placements, graph_mapper)[source]¶ Clear the recorded data from the object
Parameters: - buffer_manager – the buffer manager object
- placements – the placements object
- graph_mapper – the graph mapper object
Return type: None
-
create_machine_vertex
(vertex_slice, resources_required, label=None, constraints=None)[source]¶ Create a machine vertex from this application vertex
Parameters: - vertex_slice (Slice) – The slice of atoms that the machine vertex will cover
- resources_required (ResourceContainer) – the resources used by the machine vertex
- label (str or None) – human readable label for the machine vertex
- constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex
-
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.
-
duration
¶
-
generate_data_specification
(spec, placement, machine_time_step, time_scale_factor, graph_mapper, routing_info, data_n_time_steps, graph)[source]¶ Generate a data specification.
Parameters: - spec (DataSpecificationGenerator) – The data specification to write to
- placement (Placement) – the placement the vertex is located at
Return type: None
-
get_binary_start_type
()[source]¶ Get the start type of the binary to be run.
Return type: ExecutableType
-
get_outgoing_partition_constraints
(partition)[source]¶ Get constraints to be added to the given edge that comes out of this vertex.
Parameters: partition (AbstractOutgoingEdgePartition) – An edge that comes out of this vertex Returns: A list of constraints Return type: list(AbstractConstraint)
-
static
get_params_bytes
(vertex_slice)[source]¶ Gets the size of the poisson parameters in bytes
Parameters: vertex_slice –
-
get_resources_used_by_atoms
(vertex_slice, machine_time_step)[source]¶ Get the separate resource requirements for a range of atoms
Parameters: vertex_slice (Slice) – the low value of atoms to calculate resources from Returns: a Resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource Return type: ResourceContainer Raises: None – this method does not raise any known exception
-
get_spikes
(placements, graph_mapper, buffer_manager, machine_time_step)[source]¶ Get the recorded spikes from the object
Parameters: - placements – the placements object
- graph_mapper – the graph mapper object
- buffer_manager – the buffer manager object
- machine_time_step – the time step of the simulation
Returns: A numpy array of 2-element arrays of (neuron_id, time) ordered by time
-
get_spikes_sampling_interval
()[source]¶ Return the current sampling interval for spikes
Returns: Sampling interval in micro seconds
-
is_recording_spikes
()[source]¶ Determine if spikes are being recorded
Returns: True if spikes are being recorded, False otherwise Return type: bool
-
mark_no_changes
()[source]¶ Marks the point after which changes are reported, so that new changes can be detected before the next check.
-
max_rate
¶
-
n_atoms
¶ The number of atoms in the vertex
Return type: int
-
rate
¶
-
read_parameters_from_machine
(transceiver, placement, vertex_slice)[source]¶ Read the parameters from the machine before any are changed
Parameters: - transceiver – the SpinnMan interface
- placement – the placement of a vertex
- vertex_slice – the slice of atoms for this vertex
-
regenerate_data_specification
(spec, placement, machine_time_step, time_scale_factor, graph_mapper, routing_info, graph)[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?
-
requires_mapping
¶ True if changes that have been made require that mapping be performed. By default this returns False but can be overridden to indicate changes that require mapping.
Return type: bool
-
requires_memory_regions_to_be_reloaded
()[source]¶ Return true if any data region needs to be reloaded
Return type: bool
-
reserve_memory_regions
(spec, placement, graph_mapper)[source]¶ Reserve memory regions for poisson source parameters and output buffer.
Parameters: - spec – the data specification writer
- placement – the location this vertex resides on in the machine
- graph_mapper – the mapping between app and machine graphs
Returns: None
-
seed
¶
-
set_recording_spikes
(new_state=True, sampling_interval=None, indexes=None)[source]¶ Set spikes to being recorded. If new_state is false all other parameters are ignored.
Parameters: - new_state (bool) – Set if the spikes are recording or not
- sampling_interval – The interval at which spikes are recorded. Must be a whole multiple of the timestep None will be taken as the timestep
- indexes – The indexes of the neurons that will record spikes. If None the assumption is all neurons are recording
-
set_value
(key, value)[source]¶ Set a property
Parameters: - key – the name of the parameter to change
- value – the new value of the parameter to assign
-
start
¶
-
Module contents¶
-
class
spynnaker.pyNN.models.spike_source.
SpikeSourceArray
(spike_times=[])[source]¶ Bases:
spynnaker.pyNN.models.abstract_pynn_model.AbstractPyNNModel
-
create_vertex
(n_neurons, label, constraints)[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
- constraints (list or None) – A list of constraints to give to the vertex, or None
Returns: An application vertex for the population
Return type:
-
default_population_parameters
= {}¶
-
-
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')[source]¶ Bases:
spynnaker.pyNN.models.spike_source.spike_source_array.SpikeSourceArray
SpikeSourceArray that works from a file
-
spike_times
¶
-
-
class
spynnaker.pyNN.models.spike_source.
SpikeSourcePoisson
(rate=1.0, start=0, duration=None)[source]¶ Bases:
spynnaker.pyNN.models.abstract_pynn_model.AbstractPyNNModel
-
create_vertex
(n_neurons, label, constraints, seed, max_rate)[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
- constraints (list or None) – A list of constraints to give to the vertex, or None
Returns: An application vertex for the population
Return type:
-
default_population_parameters
= {'max_rate': None, 'seed': None}¶
-