spynnaker.pyNN.models.neural_projections package

Module contents

class spynnaker.pyNN.models.neural_projections.DelayAfferentApplicationEdge(pre_vertex, delay_vertex, label=None)[source]

Bases: pacman.model.graphs.application.application_edge.ApplicationEdge, pacman.model.partitioner_interfaces.abstract_slices_connect.AbstractSlicesConnect

Parameters:
could_connect(pre_slice, post_slice)[source]

Determine if there is a chance that one of the indexes in the pre-slice could connect to at least one of the indexes in the post-slice.

Note

This method should never return a false negative, but may return a false positives

Parameters:
Returns:

True if a connection could be possible

Return type:

bool

class spynnaker.pyNN.models.neural_projections.DelayedApplicationEdge(pre_vertex, post_vertex, synapse_information, undelayed_edge, label=None)[source]

Bases: pacman.model.graphs.application.application_edge.ApplicationEdge, pacman.model.partitioner_interfaces.abstract_slices_connect.AbstractSlicesConnect

Parameters:
add_synapse_information(synapse_information)[source]
Parameters:synapse_information (SynapseInformation) –
could_connect(pre_slice, post_slice)[source]

Determine if there is a chance that one of the indexes in the pre-slice could connect to at least one of the indexes in the post-slice.

Note

This method should never return a false negative, but may return a false positives

Parameters:
Returns:

True if a connection could be possible

Return type:

bool

get_machine_edge(pre_vertex, post_vertex)[source]

Get a specific machine edge from this edge

Parameters:
Return type:

MachineEdge or None

remember_associated_machine_edge(machine_edge)[source]

Adds the Machine Edge to the iterable returned by machine_edges

Parameters:machine_edge (MachineEdge) – A pointer to a machine_edge. This edge may not be fully initialised
synapse_information
Return type:list(SynapseInformation)
undelayed_edge

Get the edge that for projections without extended delays

Return type:ProjectionApplicationEdge
class spynnaker.pyNN.models.neural_projections.ProjectionApplicationEdge(pre_vertex, post_vertex, synapse_information, label=None)[source]

Bases: pacman.model.graphs.application.application_edge.ApplicationEdge, pacman.model.partitioner_interfaces.abstract_slices_connect.AbstractSlicesConnect, spinn_front_end_common.interface.provenance.abstract_provides_local_provenance_data.AbstractProvidesLocalProvenanceData

An edge which terminates on an AbstractPopulationVertex.

Parameters:
add_synapse_information(synapse_information)[source]
Parameters:synapse_information (SynapseInformation) –
could_connect(pre_slice, post_slice)[source]

Determine if there is a chance that one of the indexes in the pre-slice could connect to at least one of the indexes in the post-slice.

Note

This method should never return a false negative, but may return a false positives

Parameters:
Returns:

True if a connection could be possible

Return type:

bool

delay_edge

Settable.

Return type:DelayedApplicationEdge or None
forget_machine_edges()[source]

Clear the collection of machine edges created by this application edge.

get_local_provenance_data()[source]

Get an iterable of provenance data items.

Returns:the provenance items
Return type:iterable(ProvenanceDataItem)
get_machine_edge(pre_vertex, post_vertex)[source]

Get a specific machine edge of this edge

Parameters:
Return type:

MachineEdge or None

n_delay_stages
Return type:int
post_slices

Get the slices for the post_vertexes of the MachineEdges

While the remember machine_edges remain unchanged this will return a list with a consistent id. If the edges change a new list is created

The List will be sorted by lo_atom. No checking is done for overlaps or gaps

Returns:Ordered list of post-slices
Return type:list(Slice)
pre_slices

Get the slices for the pre_vertexes of the MachineEdges

While the remember machine_edges remain unchanged this will return a list with a consistent id. If the edges change a new list is created

The List will be sorted by lo_atom. No checking is done for overlaps or gaps

Returns:Ordered list of pre-slices
Return type:list(Slice)
remember_associated_machine_edge(machine_edge)[source]

Adds the Machine Edge to the iterable returned by machine_edges

Parameters:machine_edge (MachineEdge) – A pointer to a machine_edge. This edge may not be fully initialised
synapse_information
Return type:list(SynapseInformation)
class spynnaker.pyNN.models.neural_projections.SynapseInformation(connector, pre_population, post_population, prepop_is_view, postpop_is_view, rng, synapse_dynamics, synapse_type, is_virtual_machine, weights=None, delays=None)[source]

Bases: object

Contains the synapse information including the connector, synapse type and synapse dynamics

Parameters:
add_pre_run_connection_holder(pre_run_connection_holder)[source]

Add a connection holder that will be filled in before run

Parameters:pre_run_connection_holder (ConnectionHolder) – The connection holder to be added
connector

The connector connected to the synapse

Return type:AbstractConnector
delays

The total synaptic delays (if any)

Return type:float or list(float) or ndarray(float) or None
finish_connection_holders()[source]

Finish all the connection holders, and clear the list so that they are not generated again later

may_generate_on_machine()[source]

Do we describe a collection of synapses whose synaptic matrix may be generated on SpiNNaker instead of needing to be calculated in this process and uploaded? This depends on the connector, the definitions of the weights and delays, and the dynamics of the synapses.

Returns:True if the synaptic matrix may be generated on machine (or may have already been so done)
Return type:bool
n_post_neurons

The number of neurons in the postpopulation

Return type:int
n_pre_neurons

The number of neurons in the prepopulation

Return type:int
post_population

The population hosting the synapse

Return type:Population or PopulationView
postpop_is_view

Whether the post_population() is a view

Return type:bool
pre_population

The population sending spikes to the synapse

Return type:Population or PopulationView
pre_run_connection_holders

The list of connection holders to be filled in before run

Return type:list(ConnectionHolder)
prepop_is_view

Whether the pre_population() is a view

Return type:bool
rng

Random number generator

Return type:NumpyRNG
synapse_dynamics

The dynamic behaviour of the synapse

Return type:AbstractSynapseDynamics
synapse_type

The type of the synapse

Return type:AbstractSynapseType
weights

The synaptic weights (if any)

Return type:float or list(float) or ndarray(float) or None