spynnaker.pyNN.models.neuron package

Subpackages

Submodules

spynnaker.pyNN.models.neuron.abstract_population_vertex module

class spynnaker.pyNN.models.neuron.abstract_population_vertex.AbstractPopulationVertex(n_neurons, label, constraints, max_atoms_per_core, spikes_per_second, ring_buffer_sigma, incoming_spike_buffer_size, neuron_impl, pynn_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.abstract_models.abstract_contains_units.AbstractContainsUnits, spynnaker.pyNN.models.common.abstract_spike_recordable.AbstractSpikeRecordable, spynnaker.pyNN.models.common.abstract_neuron_recordable.AbstractNeuronRecordable, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints, spinn_front_end_common.abstract_models.abstract_provides_incoming_partition_constraints.AbstractProvidesIncomingPartitionConstraints, spynnaker.pyNN.models.abstract_models.abstract_population_initializable.AbstractPopulationInitializable, spynnaker.pyNN.models.abstract_models.abstract_population_settable.AbstractPopulationSettable, spinn_front_end_common.abstract_models.abstract_changable_after_run.AbstractChangableAfterRun, spinn_front_end_common.abstract_models.abstract_rewrites_data_specification.AbstractRewritesDataSpecification, spynnaker.pyNN.models.abstract_models.abstract_read_parameters_before_set.AbstractReadParametersBeforeSet, spynnaker.pyNN.models.abstract_models.abstract_accepts_incoming_synapses.AbstractAcceptsIncomingSynapses, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl, spinn_front_end_common.abstract_models.abstract_can_reset.AbstractCanReset

Underlying vertex model for Neural Populations.

BASIC_MALLOC_USAGE = 2
BYTES_TILL_START_OF_GLOBAL_PARAMETERS = 32
RUNTIME_SDP_PORT_SIZE = 4
SPIKE_RECORDING_REGION = 0
TRAFFIC_IDENTIFIER = 'BufferTraffic'
add_pre_run_connection_holder(connection_holder, edge, synapse_info)[source]

Add a connection holder to the vertex to be filled in when the connections are actually generated.

clear_connection_cache()[source]

Clear the connection data stored in the vertex so far.

clear_recording(variable, 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

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

conductance_based
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]

Get 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.

gen_on_machine(vertex_slice)[source]
generate_data_specification(spec, placement, machine_time_step, time_scale_factor, graph_mapper, application_graph, machine_graph, routing_info, data_n_time_steps)[source]

Generate a data specification.

Parameters:
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_connection_holders()[source]
get_connections_from_machine(transceiver, placement, edge, graph_mapper, routing_infos, synapse_information, machine_time_step, using_extra_monitor_cores, placements=None, monitor_api=None, monitor_placement=None, monitor_cores=None, handle_time_out_configuration=True, fixed_routes=None)[source]

Get the connections from the machine post-run.

get_cpu_usage_for_atoms(vertex_slice)[source]
get_data(variable, n_machine_time_steps, placements, graph_mapper, buffer_manager, machine_time_step)[source]

Get the recorded data

Parameters:
  • variable
  • n_machine_time_steps
  • placements
  • graph_mapper
  • buffer_manager
  • machine_time_step
Returns:

get_dtcm_usage_for_atoms(vertex_slice)[source]
get_incoming_partition_constraints(partition)[source]

Get constraints to be added to the given edge that goes in to a vertex of this vertex.

Parameters:
Returns:

A list of constraints

Return type:

list(AbstractConstraint) Gets the constraints for partitions going into this vertex.

Returns:

list of constraints

get_initial_value(variable, selector=None)[source]

Gets the value for any variable whose in initialize_parameters.keys

Should return the current value not the default one.

Must support the variable as listed in initialize_parameters.keys, ideally also with _init removed or added.

Parameters:
  • variable (str) – variable name with our without _init
  • selector – a description of the subrange to accept. Or None for all. See: _selector_to_ids in SpiNNUtils.spinn_utilities.ranged.abstract_sized.py
Returns:

A list or an Object which act like a list

get_maximum_delay_supported_in_ms(machine_time_step)[source]

Get the maximum delay supported by this vertex.

get_neuron_sampling_interval(variable)[source]

Returns the current sampling interval for this variable

Parameters:variable – PyNN name of the variable
Returns:Sampling interval in micro seconds
get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge that comes out of this vertex.

Parameters:
Returns:

A list of constraints

Return type:

list(AbstractConstraint) Gets the constraints for partitions going out of this vertex.

Returns:

list of constraints

get_recordable_variables()[source]

Returns a list of the variables this models is expected to collect

get_resources_used_by_atoms(vertex_slice, graph, 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
get_synapse_id_by_target(target)[source]

Get the ID of a synapse given the name.

Parameters:target (str) – The name of the synapse
Return type:int
get_units(variable)[source]

Get units for a given variable

Parameters:variable – the variable to find units from
Returns:the units as a string.
get_value(key)[source]

Get a property Get a property of the overall model.

initialize(variable, value)[source]

Set the initial value of one of the state variables of the neurons in this population.

initialize_parameters

List the parameters that are initializable.

If “foo” is initializable there should be a setter initialize_foo and a getter property foo_init

Returns:list of property names
is_recording(variable)[source]

Determines if variable is being recorded

Returns:True if variable are being recorded, False otherwise
Return type:bool
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.

mark_regions_reloaded()[source]

Indicate that the regions have been reloaded

n_atoms

The number of atoms in the vertex

Return type:int
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)[source]

Regenerate the data specification, only generating regions that have changed and need to be reloaded

Parameters:
requires_data_generation

True if changes that have been made require that data generation be performed. By default this returns False but can be overridden to indicate changes that require data regeneration.

Return type:bool
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
reset_to_first_timestep()[source]

Reset the object to first time step.

ring_buffer_sigma
set_initial_value(variable, value, selector=None)[source]

Sets the value for any variable whose in initialize_parameters.keys

Must support the variable as listed in initialize_parameters.keys, ideally also with _init removed or added

Parameters:
  • variable (str) – variable name with our without _init
  • value – New value for the variable
  • selector – a description of the subrange to accept. Or None for all. See: _selector_to_ids in SpiNNUtils.spinn_utilities.ranged.abstract_sized.py
Returns:

A list or an Object which act like a list

set_recording(variable, new_state=True, sampling_interval=None, indexes=None)[source]

Sets variable to being recorded

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_synapse_dynamics(synapse_dynamics)[source]

Set the synapse dynamics of this vertex.

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 Set a property of the overall model.
spikes_per_second
synapse_dynamics
weight_scale

spynnaker.pyNN.models.neuron.abstract_pynn_neuron_model module

class spynnaker.pyNN.models.neuron.abstract_pynn_neuron_model.AbstractPyNNNeuronModel(model)[source]

Bases: spynnaker.pyNN.models.abstract_pynn_model.AbstractPyNNModel

create_vertex(n_neurons, label, constraints, spikes_per_second, ring_buffer_sigma, incoming_spike_buffer_size)[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:

pacman.model.graphs.application.ApplicationVertex

default_population_parameters = {'incoming_spike_buffer_size': None, 'ring_buffer_sigma': None, 'spikes_per_second': None}
classmethod get_max_atoms_per_core()[source]

Get the maximum number of atoms per core for this model

Return type:int
classmethod set_model_max_atoms_per_core(n_atoms=255)[source]

Set the maximum number of atoms per core for this model

Parameters:n_atoms (int or None) – The new maximum, or None for the largest possible

spynnaker.pyNN.models.neuron.abstract_pynn_neuron_model_standard module

class spynnaker.pyNN.models.neuron.abstract_pynn_neuron_model_standard.AbstractPyNNNeuronModelStandard(model_name, binary, neuron_model, input_type, synapse_type, threshold_type, additional_input_type=None)[source]

Bases: spynnaker.pyNN.models.neuron.abstract_pynn_neuron_model.AbstractPyNNNeuronModel

spynnaker.pyNN.models.neuron.connection_holder module

class spynnaker.pyNN.models.neuron.connection_holder.ConnectionHolder(data_items_to_return, as_list, n_pre_atoms, n_post_atoms, connections=None, fixed_values=None, notify=None)[source]

Bases: object

Holds a set of connections to be returned in a PyNN-specific format

Parameters:
  • data_items_to_return – A list of data fields to be returned
  • as_list – True if the data will be returned as a list, False if it is to be returned as a matrix (or series of matrices)
  • n_pre_atoms – The number of atoms in the pre-vertex
  • n_post_atoms – The number of atoms in the post-vertex
  • connections – Any initial connections, as a numpy structured array of source, target, weight and delay
  • fixed_values – A list of tuples of field names and fixed values to be appended to the other fields per connection, formatted as [(field_name, value), …]. Note that if the field is to be returned, the name must also appear in data_items_to_return, which determines the order of items in the result
  • notify – A callback to call when the connections have all been added. This should accept a single parameter, which will contain the data requested
add_connections(connections)[source]

Add connections to the holder to be returned

Parameters:connections – The connection to add, as a numpy structured array of source, target, weight and delay
connections

The connections stored

finish()[source]

Finish adding connections

spynnaker.pyNN.models.neuron.generator_data module

class spynnaker.pyNN.models.neuron.generator_data.GeneratorData(synaptic_matrix_offset, delayed_synaptic_matrix_offset, max_row_n_words, max_delayed_row_n_words, max_row_n_synapses, max_delayed_row_n_synapses, pre_slices, pre_slice_index, post_slices, post_slice_index, pre_vertex_slice, post_vertex_slice, synapse_information, max_stage, machine_time_step)[source]

Bases: object

Data for each connection of the synapse generator.

BASE_SIZE = 68
gen_data

Get the data to be written for this connection

Return type:numpy array of uint32
size

The size of the generated data in bytes

Return type:int

spynnaker.pyNN.models.neuron.population_machine_vertex module

class spynnaker.pyNN.models.neuron.population_machine_vertex.PopulationMachineVertex(resources_required, recorded_region_ids, label, constraints)[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.interface.profiling.abstract_has_profile_data.AbstractHasProfileData

Parameters:
  • resources_required
  • recorded_region_ids
  • label
  • constraints
class EXTRA_PROVENANCE_DATA_ENTRIES

Bases: enum.Enum

An enumeration.

BUFFER_OVERFLOW_COUNT = 2
CURRENT_TIMER_TIC = 3
PLASTIC_SYNAPTIC_WEIGHT_SATURATION_COUNT = 4
PRE_SYNAPTIC_EVENT_COUNT = 0
SATURATION_COUNT = 1
N_ADDITIONAL_PROVENANCE_DATA_ITEMS = 5
PROFILE_TAG_LABELS = {0: 'TIMER', 1: 'DMA_READ', 2: 'INCOMING_SPIKE', 3: 'PROCESS_FIXED_SYNAPSES', 4: 'PROCESS_PLASTIC_SYNAPSES'}
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_provenance_data_from_machine(transceiver, placement)[source]

Retrieve the provenance data.

Parameters:
  • transceiver (Transceiver) – How to talk to the machine
  • placement (Placement) – Which vertex are we retrieving from, and where was it
Return type:

list(ProvenanceDataItem)

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_recording()[source]

Deduce if the recorder is actually recording

Return type:bool
resources_required

The resources required by the vertex

Return type:ResourceContainer

spynnaker.pyNN.models.neuron.synaptic_manager module

class spynnaker.pyNN.models.neuron.synaptic_manager.SynapticManager(n_synapse_types, ring_buffer_sigma, spikes_per_second, config, population_table_type=None, synapse_io=None)[source]

Bases: object

Deals with synapses

add_pre_run_connection_holder(connection_holder, edge, synapse_info)[source]
clear_connection_cache()[source]
gen_on_machine(vertex_slice)[source]

True if the synapses should be generated on the machine

get_connection_holders()[source]
get_connections_from_machine(transceiver, placement, machine_edge, graph_mapper, routing_infos, synapse_info, machine_time_step, using_extra_monitor_cores, placements=None, monitor_api=None, monitor_placement=None, monitor_cores=None, handle_time_out_configuration=True, fixed_routes=None)[source]
get_dtcm_usage_in_bytes()[source]
get_incoming_partition_constraints()[source]
get_maximum_delay_supported_in_ms(machine_time_step)[source]
get_n_cpu_cycles()[source]
get_sdram_usage_in_bytes(vertex_slice, in_edges, machine_time_step)[source]
ring_buffer_sigma
spikes_per_second
synapse_dynamics
vertex_executable_suffix
write_data_spec(spec, application_vertex, post_vertex_slice, machine_vertex, placement, machine_graph, application_graph, routing_info, graph_mapper, weight_scale, machine_time_step)[source]

Module contents

class spynnaker.pyNN.models.neuron.AbstractPopulationVertex(n_neurons, label, constraints, max_atoms_per_core, spikes_per_second, ring_buffer_sigma, incoming_spike_buffer_size, neuron_impl, pynn_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.abstract_models.abstract_contains_units.AbstractContainsUnits, spynnaker.pyNN.models.common.abstract_spike_recordable.AbstractSpikeRecordable, spynnaker.pyNN.models.common.abstract_neuron_recordable.AbstractNeuronRecordable, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints, spinn_front_end_common.abstract_models.abstract_provides_incoming_partition_constraints.AbstractProvidesIncomingPartitionConstraints, spynnaker.pyNN.models.abstract_models.abstract_population_initializable.AbstractPopulationInitializable, spynnaker.pyNN.models.abstract_models.abstract_population_settable.AbstractPopulationSettable, spinn_front_end_common.abstract_models.abstract_changable_after_run.AbstractChangableAfterRun, spinn_front_end_common.abstract_models.abstract_rewrites_data_specification.AbstractRewritesDataSpecification, spynnaker.pyNN.models.abstract_models.abstract_read_parameters_before_set.AbstractReadParametersBeforeSet, spynnaker.pyNN.models.abstract_models.abstract_accepts_incoming_synapses.AbstractAcceptsIncomingSynapses, spinn_front_end_common.abstract_models.impl.provides_key_to_atom_mapping_impl.ProvidesKeyToAtomMappingImpl, spinn_front_end_common.abstract_models.abstract_can_reset.AbstractCanReset

Underlying vertex model for Neural Populations.

BASIC_MALLOC_USAGE = 2
BYTES_TILL_START_OF_GLOBAL_PARAMETERS = 32
RUNTIME_SDP_PORT_SIZE = 4
SPIKE_RECORDING_REGION = 0
TRAFFIC_IDENTIFIER = 'BufferTraffic'
add_pre_run_connection_holder(connection_holder, edge, synapse_info)[source]

Add a connection holder to the vertex to be filled in when the connections are actually generated.

clear_connection_cache()[source]

Clear the connection data stored in the vertex so far.

clear_recording(variable, 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

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

conductance_based
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]

Get 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.

gen_on_machine(vertex_slice)[source]
generate_data_specification(spec, placement, machine_time_step, time_scale_factor, graph_mapper, application_graph, machine_graph, routing_info, data_n_time_steps)[source]

Generate a data specification.

Parameters:
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for this vertex.

Return type:str
get_binary_start_type()[source]

Get the start type of the binary to be run.

Return type:ExecutableType
get_connection_holders()[source]
get_connections_from_machine(transceiver, placement, edge, graph_mapper, routing_infos, synapse_information, machine_time_step, using_extra_monitor_cores, placements=None, monitor_api=None, monitor_placement=None, monitor_cores=None, handle_time_out_configuration=True, fixed_routes=None)[source]

Get the connections from the machine post-run.

get_cpu_usage_for_atoms(vertex_slice)[source]
get_data(variable, n_machine_time_steps, placements, graph_mapper, buffer_manager, machine_time_step)[source]

Get the recorded data

Parameters:
  • variable
  • n_machine_time_steps
  • placements
  • graph_mapper
  • buffer_manager
  • machine_time_step
Returns:

get_dtcm_usage_for_atoms(vertex_slice)[source]
get_incoming_partition_constraints(partition)[source]

Get constraints to be added to the given edge that goes in to a vertex of this vertex.

Parameters:
Returns:

A list of constraints

Return type:

list(AbstractConstraint) Gets the constraints for partitions going into this vertex.

Returns:

list of constraints

get_initial_value(variable, selector=None)[source]

Gets the value for any variable whose in initialize_parameters.keys

Should return the current value not the default one.

Must support the variable as listed in initialize_parameters.keys, ideally also with _init removed or added.

Parameters:
  • variable (str) – variable name with our without _init
  • selector – a description of the subrange to accept. Or None for all. See: _selector_to_ids in SpiNNUtils.spinn_utilities.ranged.abstract_sized.py
Returns:

A list or an Object which act like a list

get_maximum_delay_supported_in_ms(machine_time_step)[source]

Get the maximum delay supported by this vertex.

get_neuron_sampling_interval(variable)[source]

Returns the current sampling interval for this variable

Parameters:variable – PyNN name of the variable
Returns:Sampling interval in micro seconds
get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge that comes out of this vertex.

Parameters:
Returns:

A list of constraints

Return type:

list(AbstractConstraint) Gets the constraints for partitions going out of this vertex.

Returns:

list of constraints

get_recordable_variables()[source]

Returns a list of the variables this models is expected to collect

get_resources_used_by_atoms(vertex_slice, graph, 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
get_synapse_id_by_target(target)[source]

Get the ID of a synapse given the name.

Parameters:target (str) – The name of the synapse
Return type:int
get_units(variable)[source]

Get units for a given variable

Parameters:variable – the variable to find units from
Returns:the units as a string.
get_value(key)[source]

Get a property Get a property of the overall model.

initialize(variable, value)[source]

Set the initial value of one of the state variables of the neurons in this population.

initialize_parameters

List the parameters that are initializable.

If “foo” is initializable there should be a setter initialize_foo and a getter property foo_init

Returns:list of property names
is_recording(variable)[source]

Determines if variable is being recorded

Returns:True if variable are being recorded, False otherwise
Return type:bool
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.

mark_regions_reloaded()[source]

Indicate that the regions have been reloaded

n_atoms

The number of atoms in the vertex

Return type:int
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)[source]

Regenerate the data specification, only generating regions that have changed and need to be reloaded

Parameters:
requires_data_generation

True if changes that have been made require that data generation be performed. By default this returns False but can be overridden to indicate changes that require data regeneration.

Return type:bool
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
reset_to_first_timestep()[source]

Reset the object to first time step.

ring_buffer_sigma
set_initial_value(variable, value, selector=None)[source]

Sets the value for any variable whose in initialize_parameters.keys

Must support the variable as listed in initialize_parameters.keys, ideally also with _init removed or added

Parameters:
  • variable (str) – variable name with our without _init
  • value – New value for the variable
  • selector – a description of the subrange to accept. Or None for all. See: _selector_to_ids in SpiNNUtils.spinn_utilities.ranged.abstract_sized.py
Returns:

A list or an Object which act like a list

set_recording(variable, new_state=True, sampling_interval=None, indexes=None)[source]

Sets variable to being recorded

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_synapse_dynamics(synapse_dynamics)[source]

Set the synapse dynamics of this vertex.

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 Set a property of the overall model.
spikes_per_second
synapse_dynamics
weight_scale
class spynnaker.pyNN.models.neuron.ConnectionHolder(data_items_to_return, as_list, n_pre_atoms, n_post_atoms, connections=None, fixed_values=None, notify=None)[source]

Bases: object

Holds a set of connections to be returned in a PyNN-specific format

Parameters:
  • data_items_to_return – A list of data fields to be returned
  • as_list – True if the data will be returned as a list, False if it is to be returned as a matrix (or series of matrices)
  • n_pre_atoms – The number of atoms in the pre-vertex
  • n_post_atoms – The number of atoms in the post-vertex
  • connections – Any initial connections, as a numpy structured array of source, target, weight and delay
  • fixed_values – A list of tuples of field names and fixed values to be appended to the other fields per connection, formatted as [(field_name, value), …]. Note that if the field is to be returned, the name must also appear in data_items_to_return, which determines the order of items in the result
  • notify – A callback to call when the connections have all been added. This should accept a single parameter, which will contain the data requested
add_connections(connections)[source]

Add connections to the holder to be returned

Parameters:connections – The connection to add, as a numpy structured array of source, target, weight and delay
connections

The connections stored

finish()[source]

Finish adding connections

class spynnaker.pyNN.models.neuron.SynapticManager(n_synapse_types, ring_buffer_sigma, spikes_per_second, config, population_table_type=None, synapse_io=None)[source]

Bases: object

Deals with synapses

add_pre_run_connection_holder(connection_holder, edge, synapse_info)[source]
clear_connection_cache()[source]
gen_on_machine(vertex_slice)[source]

True if the synapses should be generated on the machine

get_connection_holders()[source]
get_connections_from_machine(transceiver, placement, machine_edge, graph_mapper, routing_infos, synapse_info, machine_time_step, using_extra_monitor_cores, placements=None, monitor_api=None, monitor_placement=None, monitor_cores=None, handle_time_out_configuration=True, fixed_routes=None)[source]
get_dtcm_usage_in_bytes()[source]
get_incoming_partition_constraints()[source]
get_maximum_delay_supported_in_ms(machine_time_step)[source]
get_n_cpu_cycles()[source]
get_sdram_usage_in_bytes(vertex_slice, in_edges, machine_time_step)[source]
ring_buffer_sigma
spikes_per_second
synapse_dynamics
vertex_executable_suffix
write_data_spec(spec, application_vertex, post_vertex_slice, machine_vertex, placement, machine_graph, application_graph, routing_info, graph_mapper, weight_scale, machine_time_step)[source]
class spynnaker.pyNN.models.neuron.PopulationMachineVertex(resources_required, recorded_region_ids, label, constraints)[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.interface.profiling.abstract_has_profile_data.AbstractHasProfileData

Parameters:
  • resources_required
  • recorded_region_ids
  • label
  • constraints
class EXTRA_PROVENANCE_DATA_ENTRIES

Bases: enum.Enum

An enumeration.

BUFFER_OVERFLOW_COUNT = 2
CURRENT_TIMER_TIC = 3
PLASTIC_SYNAPTIC_WEIGHT_SATURATION_COUNT = 4
PRE_SYNAPTIC_EVENT_COUNT = 0
SATURATION_COUNT = 1
N_ADDITIONAL_PROVENANCE_DATA_ITEMS = 5
PROFILE_TAG_LABELS = {0: 'TIMER', 1: 'DMA_READ', 2: 'INCOMING_SPIKE', 3: 'PROCESS_FIXED_SYNAPSES', 4: 'PROCESS_PLASTIC_SYNAPSES'}
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_provenance_data_from_machine(transceiver, placement)[source]

Retrieve the provenance data.

Parameters:
  • transceiver (Transceiver) – How to talk to the machine
  • placement (Placement) – Which vertex are we retrieving from, and where was it
Return type:

list(ProvenanceDataItem)

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_recording()[source]

Deduce if the recorder is actually recording

Return type:bool
resources_required

The resources required by the vertex

Return type:ResourceContainer
class spynnaker.pyNN.models.neuron.AbstractPyNNNeuronModel(model)[source]

Bases: spynnaker.pyNN.models.abstract_pynn_model.AbstractPyNNModel

create_vertex(n_neurons, label, constraints, spikes_per_second, ring_buffer_sigma, incoming_spike_buffer_size)[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:

pacman.model.graphs.application.ApplicationVertex

default_population_parameters = {'incoming_spike_buffer_size': None, 'ring_buffer_sigma': None, 'spikes_per_second': None}
classmethod get_max_atoms_per_core()[source]

Get the maximum number of atoms per core for this model

Return type:int
classmethod set_model_max_atoms_per_core(n_atoms=255)[source]

Set the maximum number of atoms per core for this model

Parameters:n_atoms (int or None) – The new maximum, or None for the largest possible
class spynnaker.pyNN.models.neuron.AbstractPyNNNeuronModelStandard(model_name, binary, neuron_model, input_type, synapse_type, threshold_type, additional_input_type=None)[source]

Bases: spynnaker.pyNN.models.neuron.abstract_pynn_neuron_model.AbstractPyNNNeuronModel