spynnaker8.models.connectors package¶
Submodules¶
spynnaker8.models.connectors.all_to_all_connector module¶
-
class
spynnaker8.models.connectors.all_to_all_connector.
AllToAllConnector
(allow_self_connections=True, safe=True, verbose=None, callbacks=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.all_to_all_connector.AllToAllConnector
,pyNN.connectors.AllToAllConnector
Connects all cells in the presynaptic population to all cells in the postsynaptic population
Parameters: - allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
- safe – if True, check that weights and delays have valid values. If False, this check is skipped.
- verbose –
- callbacks –
spynnaker8.models.connectors.array_connector module¶
-
class
spynnaker8.models.connectors.array_connector.
ArrayConnector
(array, safe=True, callback=None, verbose=False)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.array_connector.ArrayConnector
Create an array connector.
Parameters: array (integer) – an array of integers
spynnaker8.models.connectors.csa_connector module¶
-
class
spynnaker8.models.connectors.csa_connector.
CSAConnector
(cset, safe=True, callback=None, verbose=False)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.csa_connector.CSAConnector
Create an CSA (Connection Set Algebra, Djurfeldt 2012) connector.
Parameters: cset (string) – a connection set description
spynnaker8.models.connectors.distance_dependent_probability_connector module¶
-
class
spynnaker8.models.connectors.distance_dependent_probability_connector.
DistanceDependentProbabilityConnector
(d_expression, allow_self_connections=True, safe=True, verbose=False, n_connections=None, rng=None, callback=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.distance_dependent_probability_connector.DistanceDependentProbabilityConnector
,pyNN.connectors.DistanceDependentProbabilityConnector
Make connections using a distribution which varies with distance.
Parameters: - d_expression (string) – the right-hand side of a valid python expression for probability, involving ‘d’, e.g. “exp(-abs(d))”, or “d<3”, that can be parsed by eval(), that computes the distance dependent distribution
- allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
- n_connections (int) – The number of efferent synaptic connections per neuron.
- safe – if True, check that weights and delays have valid values. If False, this check is skipped.
spynnaker8.models.connectors.fixed_number_post_connector module¶
-
class
spynnaker8.models.connectors.fixed_number_post_connector.
FixedNumberPostConnector
(n, allow_self_connections=True, safe=True, verbose=False, with_replacement=False, rng=None, callback=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.fixed_number_post_connector.FixedNumberPostConnector
,pyNN.connectors.FixedNumberPostConnector
PyNN connector that puts a fixed number of connections on each of the post neurons
Parameters: - n (int) – number of random post-synaptic neurons connected to pre-neurons
- allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
- safe (bool) – Whether to check that weights and delays have valid values; if False, this check is skipped.
- verbose (bool) – Whether to output extra information about the connectivity to a CSV file
- with_replacement (bool) – if False, once a connection is made, it can’t be made again; if True, multiple connections between the same pair of neurons are allowed
- rng – random number generator
- callback – list of callbacks to run
spynnaker8.models.connectors.fixed_number_pre_connector module¶
-
class
spynnaker8.models.connectors.fixed_number_pre_connector.
FixedNumberPreConnector
(n, allow_self_connections=True, safe=True, verbose=False, with_replacement=False, rng=None, callback=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.fixed_number_pre_connector.FixedNumberPreConnector
,pyNN.connectors.FixedNumberPreConnector
Connects a fixed number of pre-synaptic neurons selected at random, to all post-synaptic neurons
Parameters: - n (int) – number of random pre-synaptic neurons connected to post-neurons
- allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
- safe (bool) – Whether to check that weights and delays have valid values. If False, this check is skipped.
- verbose (bool) – Whether to output extra information about the connectivity to a CSV file
- with_replacement (bool) – if False, once a connection is made, it can’t be made again; if True, multiple connections between the same pair of neurons are allowed
- rng –
- callback –
spynnaker8.models.connectors.fixed_probability_connector module¶
-
class
spynnaker8.models.connectors.fixed_probability_connector.
FixedProbabilityConnector
(p_connect, allow_self_connections=True, safe=True, verbose=False, rng=None, callback=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.fixed_probability_connector.FixedProbabilityConnector
,pyNN.connectors.FixedProbabilityConnector
For each pair of pre-post cells, the connection probability is constant.
Parameters: - p_connect (float) – a number between zero and one. Each potential connection is created with this probability.
- allow_self_connections – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
- safe – if True, check that weights and delays have valid values. If False, this check is skipped.
- space – a Space object, needed if you wish to specify distance-dependent weights or delays - not implemented
- verbose –
- rng –
- callback –
-
p_connect
¶
spynnaker8.models.connectors.from_file_connector module¶
-
class
spynnaker8.models.connectors.from_file_connector.
FromFileConnector
(file, distributed=False, safe=True, callback=None, verbose=False)[source]¶ Bases:
spynnaker8.models.connectors.from_list_connector.FromListConnector
,pyNN.connectors.FromFileConnector
spynnaker8.models.connectors.from_list_connector module¶
-
class
spynnaker8.models.connectors.from_list_connector.
FromListConnector
(conn_list, safe=True, verbose=False, column_names=None, callback=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.from_list_connector.FromListConnector
,pyNN.connectors.Connector
Make connections according to a list.
Parameters: - conn_list – a list of tuples, one tuple for each connection. Each tuple should contain: (pre_idx, post_idx, p1, p2, …, pn) where pre_idx is the index (i.e. order in the Population, not the ID) of the presynaptic neuron, post_idx is the index of the postsynaptic neuron, and p1, p2, etc. are the synaptic parameters (e.g., weight, delay, plasticity parameters).
- column_names – the names of the parameters p1, p2, etc. If not provided, it is assumed the parameters are weight, delay (for backwards compatibility).
- safe – if True, check that weights and delays have valid values. If False, this check is skipped.
- callback – if given, a callable that display a progress bar on the terminal.
spynnaker8.models.connectors.index_based_probability_connector module¶
-
class
spynnaker8.models.connectors.index_based_probability_connector.
IndexBasedProbabilityConnector
(index_expression, allow_self_connections=True, rng=None, safe=True, callback=None, verbose=False)[source]¶ -
Create an index-based probability connector. The index_expression must depend on the indices i, j of the populations.
Parameters: - index_expression (str) – a function of the indices of the populations An expression
- allow_self_connections (bool) – allow a neuron to connect to itself
spynnaker8.models.connectors.kernel_connector module¶
-
class
spynnaker8.models.connectors.kernel_connector.
KernelConnector
(shape_pre, shape_post, shape_kernel, weight_kernel=None, delay_kernel=None, shape_common=None, pre_sample_steps=None, pre_start_coords=None, post_sample_steps=None, post_start_coords=None, safe=True, space=None, verbose=False)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.kernel_connector.KernelConnector
Where the pre- and post-synaptic populations are considered as a 2D array. Connect every post(row, col) neuron to many pre(row, col, kernel) through a (kernel) set of weights and/or delays.
TODO: should these include allow_self_connections and with_replacement?
Parameters: - shape_pre – 2D shape of the pre population (rows/height, cols/width, usually the input image shape)
- shape_post – 2D shape of the post population (rows/height, cols/width)
- shape_kernel – 2D shape of the kernel (rows/height, cols/width)
- (optional) (pre/post_start_coords) – 2D matrix of size shape_kernel describing the weights
- (optional) – 2D matrix of size shape_kernel describing the delays
- (optional) – 2D shape of common coordinate system (for both pre and post, usually the input image sizes)
- (optional) – Sampling steps/jumps for pre/post pop <=> (startX, endX, _stepX_) None or 2-item array
- (optional) – Starting row/col for pre/post sampling <=> (_startX_, endX, stepX) None or 2-item array
spynnaker8.models.connectors.multapse_connector module¶
-
class
spynnaker8.models.connectors.multapse_connector.
MultapseConnector
(n, allow_self_connections=True, with_replacement=True, safe=True, verbose=False, rng=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.multapse_connector.MultapseConnector
Create a multapse connector. The size of the source and destination populations are obtained when the projection is connected. The number of synapses is specified. when instantiated, the required number of synapses is created by selecting at random from the source and target populations with replacement. Uniform selection probability is assumed.
Parameters: - n (int) – This is the total number of synapses in the connection.
- allow_self_connections (bool) – Bool. Allow a neuron to connect to itself or not.
- with_replacement (bool) – Bool. When selecting, allow a neuron to be re-selected or not.
spynnaker8.models.connectors.one_to_one_connector module¶
-
class
spynnaker8.models.connectors.one_to_one_connector.
OneToOneConnector
(safe=True, callback=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.one_to_one_connector.OneToOneConnector
,pyNN.connectors.OneToOneConnector
Where the pre- and postsynaptic populations have the same size, connect cell i in the presynaptic population to cell i in the postsynaptic population for all i.
Parameters: - safe – if True, check that weights and delays have valid values. If False, this check is skipped.
- callback – a function that will be called with the fractional progress of the connection routine. An example would be progress_bar.set_level.
spynnaker8.models.connectors.small_world_connector module¶
-
class
spynnaker8.models.connectors.small_world_connector.
SmallWorldConnector
(degree, rewiring, allow_self_connections=True, space=<pyNN.space.Space object>, safe=True, verbose=False, n_connections=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.small_world_connector.SmallWorldConnector
Module contents¶
-
class
spynnaker8.models.connectors.
AllToAllConnector
(allow_self_connections=True, safe=True, verbose=None, callbacks=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.all_to_all_connector.AllToAllConnector
,pyNN.connectors.AllToAllConnector
Connects all cells in the presynaptic population to all cells in the postsynaptic population
Parameters: - allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
- safe – if True, check that weights and delays have valid values. If False, this check is skipped.
- verbose –
- callbacks –
-
class
spynnaker8.models.connectors.
ArrayConnector
(array, safe=True, callback=None, verbose=False)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.array_connector.ArrayConnector
Create an array connector.
Parameters: array (integer) – an array of integers
-
class
spynnaker8.models.connectors.
CSAConnector
(cset, safe=True, callback=None, verbose=False)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.csa_connector.CSAConnector
Create an CSA (Connection Set Algebra, Djurfeldt 2012) connector.
Parameters: cset (string) – a connection set description
-
class
spynnaker8.models.connectors.
DistanceDependentProbabilityConnector
(d_expression, allow_self_connections=True, safe=True, verbose=False, n_connections=None, rng=None, callback=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.distance_dependent_probability_connector.DistanceDependentProbabilityConnector
,pyNN.connectors.DistanceDependentProbabilityConnector
Make connections using a distribution which varies with distance.
Parameters: - d_expression (string) – the right-hand side of a valid python expression for probability, involving ‘d’, e.g. “exp(-abs(d))”, or “d<3”, that can be parsed by eval(), that computes the distance dependent distribution
- allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
- n_connections (int) – The number of efferent synaptic connections per neuron.
- safe – if True, check that weights and delays have valid values. If False, this check is skipped.
-
class
spynnaker8.models.connectors.
FixedNumberPostConnector
(n, allow_self_connections=True, safe=True, verbose=False, with_replacement=False, rng=None, callback=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.fixed_number_post_connector.FixedNumberPostConnector
,pyNN.connectors.FixedNumberPostConnector
PyNN connector that puts a fixed number of connections on each of the post neurons
Parameters: - n (int) – number of random post-synaptic neurons connected to pre-neurons
- allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
- safe (bool) – Whether to check that weights and delays have valid values; if False, this check is skipped.
- verbose (bool) – Whether to output extra information about the connectivity to a CSV file
- with_replacement (bool) – if False, once a connection is made, it can’t be made again; if True, multiple connections between the same pair of neurons are allowed
- rng – random number generator
- callback – list of callbacks to run
-
class
spynnaker8.models.connectors.
FixedNumberPreConnector
(n, allow_self_connections=True, safe=True, verbose=False, with_replacement=False, rng=None, callback=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.fixed_number_pre_connector.FixedNumberPreConnector
,pyNN.connectors.FixedNumberPreConnector
Connects a fixed number of pre-synaptic neurons selected at random, to all post-synaptic neurons
Parameters: - n (int) – number of random pre-synaptic neurons connected to post-neurons
- allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
- safe (bool) – Whether to check that weights and delays have valid values. If False, this check is skipped.
- verbose (bool) – Whether to output extra information about the connectivity to a CSV file
- with_replacement (bool) – if False, once a connection is made, it can’t be made again; if True, multiple connections between the same pair of neurons are allowed
- rng –
- callback –
-
class
spynnaker8.models.connectors.
FixedProbabilityConnector
(p_connect, allow_self_connections=True, safe=True, verbose=False, rng=None, callback=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.fixed_probability_connector.FixedProbabilityConnector
,pyNN.connectors.FixedProbabilityConnector
For each pair of pre-post cells, the connection probability is constant.
Parameters: - p_connect (float) – a number between zero and one. Each potential connection is created with this probability.
- allow_self_connections – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
- safe – if True, check that weights and delays have valid values. If False, this check is skipped.
- space – a Space object, needed if you wish to specify distance-dependent weights or delays - not implemented
- verbose –
- rng –
- callback –
-
p_connect
¶
-
class
spynnaker8.models.connectors.
FromFileConnector
(file, distributed=False, safe=True, callback=None, verbose=False)[source]¶ Bases:
spynnaker8.models.connectors.from_list_connector.FromListConnector
,pyNN.connectors.FromFileConnector
-
class
spynnaker8.models.connectors.
FromListConnector
(conn_list, safe=True, verbose=False, column_names=None, callback=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.from_list_connector.FromListConnector
,pyNN.connectors.Connector
Make connections according to a list.
Parameters: - conn_list – a list of tuples, one tuple for each connection. Each tuple should contain: (pre_idx, post_idx, p1, p2, …, pn) where pre_idx is the index (i.e. order in the Population, not the ID) of the presynaptic neuron, post_idx is the index of the postsynaptic neuron, and p1, p2, etc. are the synaptic parameters (e.g., weight, delay, plasticity parameters).
- column_names – the names of the parameters p1, p2, etc. If not provided, it is assumed the parameters are weight, delay (for backwards compatibility).
- safe – if True, check that weights and delays have valid values. If False, this check is skipped.
- callback – if given, a callable that display a progress bar on the terminal.
-
class
spynnaker8.models.connectors.
IndexBasedProbabilityConnector
(index_expression, allow_self_connections=True, rng=None, safe=True, callback=None, verbose=False)[source]¶ -
Create an index-based probability connector. The index_expression must depend on the indices i, j of the populations.
Parameters: - index_expression (str) – a function of the indices of the populations An expression
- allow_self_connections (bool) – allow a neuron to connect to itself
-
spynnaker8.models.connectors.
FixedTotalNumberConnector
¶ alias of
spynnaker8.models.connectors.multapse_connector.MultapseConnector
-
class
spynnaker8.models.connectors.
OneToOneConnector
(safe=True, callback=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.one_to_one_connector.OneToOneConnector
,pyNN.connectors.OneToOneConnector
Where the pre- and postsynaptic populations have the same size, connect cell i in the presynaptic population to cell i in the postsynaptic population for all i.
Parameters: - safe – if True, check that weights and delays have valid values. If False, this check is skipped.
- callback – a function that will be called with the fractional progress of the connection routine. An example would be progress_bar.set_level.
-
class
spynnaker8.models.connectors.
SmallWorldConnector
(degree, rewiring, allow_self_connections=True, space=<pyNN.space.Space object>, safe=True, verbose=False, n_connections=None)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.small_world_connector.SmallWorldConnector
-
class
spynnaker8.models.connectors.
KernelConnector
(shape_pre, shape_post, shape_kernel, weight_kernel=None, delay_kernel=None, shape_common=None, pre_sample_steps=None, pre_start_coords=None, post_sample_steps=None, post_start_coords=None, safe=True, space=None, verbose=False)[source]¶ Bases:
spynnaker.pyNN.models.neural_projections.connectors.kernel_connector.KernelConnector
Where the pre- and post-synaptic populations are considered as a 2D array. Connect every post(row, col) neuron to many pre(row, col, kernel) through a (kernel) set of weights and/or delays.
TODO: should these include allow_self_connections and with_replacement?
Parameters: - shape_pre – 2D shape of the pre population (rows/height, cols/width, usually the input image shape)
- shape_post – 2D shape of the post population (rows/height, cols/width)
- shape_kernel – 2D shape of the kernel (rows/height, cols/width)
- (optional) (pre/post_start_coords) – 2D matrix of size shape_kernel describing the weights
- (optional) – 2D matrix of size shape_kernel describing the delays
- (optional) – 2D shape of common coordinate system (for both pre and post, usually the input image sizes)
- (optional) – Sampling steps/jumps for pre/post pop <=> (startX, endX, _stepX_) None or 2-item array
- (optional) – Starting row/col for pre/post sampling <=> (_startX_, endX, stepX) None or 2-item array