spynnaker.pyNN.models.abstract_models package

Module contents

class spynnaker.pyNN.models.abstract_models.AbstractAcceptsIncomingSynapses[source]

Bases: object

Indicates an application vertex that can be a post-vertex in a PyNN projection.

clear_connection_cache()[source]

Clear the connection data stored in the vertex so far.

get_connections_from_machine(transceiver, placements, app_edge, synapse_info)[source]

Get the connections from the machine post-run.

Parameters:
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
set_synapse_dynamics(synapse_dynamics)[source]

Set the synapse dynamics of this vertex.

Parameters:synapse_dynamics (AbstractSynapseDynamics) –
verify_splitter(splitter)[source]

Check that the splitter implements the API(s) expected by the SynapticMatrices

Any Vertex that implements this api should override ApplicationVertex.splitter method to also call this function

Parameters:splitter (AbstractSpynnakerSplitterDelay) – the splitter
Raises:PacmanConfigurationException – if the splitter is not an instance of AbstractSpynnakerSplitterDelay
class spynnaker.pyNN.models.abstract_models.AbstractContainsUnits[source]

Bases: object

Indicates an application vertex class that can describe the units of some of its variables.

get_units(variable)[source]

Get units for a given variable.

Parameters:variable (str) – the variable to find units from
Returns:the units as a string.
Return type:str
class spynnaker.pyNN.models.abstract_models.AbstractHasDelayStages[source]

Bases: object

Indicates that this object (an application vertex) has delay stages that are used to increase the space required for bitfields in spynnaker.pyNN.utilities.bit_field_utilities.get_estimated_sdram_for_bit_field_region()

n_delay_stages

The maximum number of delay stages required by any connection out of this delay extension vertex

Return type:int
class spynnaker.pyNN.models.abstract_models.AbstractMaxSpikes[source]

Bases: object

Indicates a class (a MachineVertex) that can describe the maximum rate that it sends spikes.

The SynapticManager assumes that all machine vertexes share the same synapse_information will have the same rates.

max_spikes_per_second()[source]

Get maximum expected number of spikes per second

Parameters:variable (str) – the variable to find units from
Returns:the units as a string.
Return type:str
max_spikes_per_ts()[source]

Get maximum expected number of spikes per timestep

Return type:int
class spynnaker.pyNN.models.abstract_models.AbstractPopulationInitializable[source]

Bases: object

Indicates that this application vertex has properties that can be initialised by a PyNN Population

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:
Returns:

A list or an Object which act like a list

Return type:

iterable

get_initial_values(selector=None)[source]

A dict containing the initial values of the state variables.

Parameters:selector (None or slice or int or list(bool) or list(int)) – a description of the subrange to accept, or None for all. See: selector_to_ids()
Return type:dict(str,Any)
initial_values

A dict containing the initial values of the state variables.

Return type:dict(str,Any)
initialize(variable, value, selector=None)[source]

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

Parameters:
  • variable (str) – The name of the variable to set
  • value (float or int or Any) – The value of the variable to set
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
Return type:iterable(str)
class spynnaker.pyNN.models.abstract_models.AbstractPopulationSettable[source]

Bases: spynnaker.pyNN.models.abstract_models.abstract_settable.AbstractSettable

Indicates that some properties of this application vertex can be accessed from the PyNN population set and get methods.

get_value_by_selector(selector, key)[source]

Gets the value for a particular key but only for the selected subset.

Parameters:
  • selector (None or slice or int or list(bool) or list(int)) – See get_value_by_selector() as this is just a pass through method
  • key (str) – the name of the parameter to change
Return type:

list(float or int)

n_atoms

” See n_atoms()

set_value_by_selector(selector, key, value)[source]

Sets the value for a particular key but only for the selected subset.

Parameters:
class spynnaker.pyNN.models.abstract_models.AbstractReadParametersBeforeSet[source]

Bases: object

A vertex whose parameters must be read before any can be set.

read_parameters_from_machine(transceiver, placement, vertex_slice)[source]

Read the parameters from the machine before any are changed.

Parameters:
  • transceiver (Transceiver) – the SpinnMan interface
  • placement (Placement) – the placement of a vertex
  • vertex_slice (Slice) – the slice of atoms for this vertex
Return type:

None

class spynnaker.pyNN.models.abstract_models.AbstractSettable[source]

Bases: object

Indicates that some properties of this object can be accessed from the PyNN population set and get methods.

get_value(key)[source]

Get a property

Parameters:key (str) – the name of the property
Return type:Any or float or int or list(float) or list(int)
set_value(key, value)[source]

Set a property

Parameters:
  • key (str) – the name of the parameter to change
  • value (Any or float or int or list(float) or list(int)) – the new value of the parameter to assign
class spynnaker.pyNN.models.abstract_models.AbstractSynapseExpandable[source]

Bases: object

Indicates a class (a MachineVertex) that has may need to run the SYNAPSE_EXPANDER aplx

Cores that do not use the synapse_manager should not implement this API even though their app vertex may hold a synapse_manager.

Note

This is not implemented by the DelayExtensionMachineVertex, which needs a different expander aplx

gen_on_machine()[source]

True if the synapses of a the slice of this vertex should be generated on the machine.

Note

The typical implementation for this method will be to ask the app_vertex’s synapse_manager

Return type:bool
read_generated_connection_holders(transceiver, placement)[source]

Fill in the connection holders

Note

The typical implementation for this method will be to ask the app_vertex’s synapse_manager

Parameters:
  • transceiver (Transceiver) – How the data is to be read
  • placement (Placement) – Where the data is on the machine
class spynnaker.pyNN.models.abstract_models.AbstractWeightUpdatable[source]

Bases: object

An object whose weight can be updated.

update_weight()[source]

Update the weight.