spynnaker.pyNN.models.neuron.synapse_dynamics package¶
Module contents¶
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractGenerateOnMachine¶
Bases:
object
A synapse dynamics that can be generated on the machine.
- abstract gen_matrix_params(synaptic_matrix_offset, delayed_matrix_offset, app_edge, synapse_info, max_row_info, max_pre_atoms_per_core, max_post_atoms_per_core)[source]¶
Any parameters required by the matrix generator.
- Return type:
ndarray(uint32)
- abstract property gen_matrix_params_size_in_bytes¶
The size of the parameters of the matrix generator in bytes.
- Return type:
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractPlasticSynapseDynamics¶
Bases:
AbstractSDRAMSynapseDynamics
Synapses which change over time.
- abstract get_n_fixed_plastic_words_per_row(fp_size)[source]¶
Get the number of fixed plastic words to be read from each row.
- Parameters:
fp_size (ndarray) –
- abstract get_n_plastic_plastic_words_per_row(pp_size)[source]¶
Get the number of plastic plastic words to be read from each row.
- Parameters:
pp_size (ndarray) –
- abstract get_n_synapses_in_rows(pp_size, fp_size)[source]¶
Get the number of synapses in each of the rows with plastic sizes pp_size and fp_size.
- abstract get_n_words_for_plastic_connections(n_connections)[source]¶
Get the number of 32-bit words for n_connections in a single row.
- abstract get_plastic_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types, max_n_synapses, max_atoms_per_core)[source]¶
Get the fixed-plastic data, and plastic-plastic data for each row, and lengths for the fixed_plastic and plastic-plastic parts of each row.
Data is returned as an array made up of an array of 32-bit words for each row, for each of the fixed-plastic and plastic-plastic data regions. The row into which connection should go is given by connection_row_indices, and the total number of rows is given by n_rows.
Lengths are returned as an array made up of an integer for each row, for each of the fixed-plastic and plastic-plastic regions.
- Parameters:
connections (ndarray) – The connections to get data for
connection_row_indices (ndarray) – The row into which each connection should go
n_rows (int) – The total number of rows
post_vertex_slice (Slice) – The slice of the post vertex to get the connections for
n_synapse_types (int) – The number of synapse types
max_n_synapses (int) – The maximum number of synapses to generate
max_atoms_per_core (int) – The maximum number of atoms on a core
- Returns:
(fp_data, pp_data, fp_size, pp_size)
- Return type:
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractSDRAMSynapseDynamics¶
Bases:
AbstractSynapseDynamics
How do the dynamics of a synapse interact with the rest of the model.
- NUMPY_CONNECTORS_DTYPE = [('source', 'uint32'), ('target', 'uint32'), ('weight', 'float64'), ('delay', 'float64')]¶
- convert_per_connection_data_to_rows(connection_row_indices, n_rows, data, max_n_synapses)[source]¶
Converts per-connection data generated from connections into row-based data to be returned from get_synaptic_data.
- abstract get_max_synapses(n_words)[source]¶
Get the maximum number of synapses that can be held in the given number of words.
- get_n_items(rows, item_size)[source]¶
Get the number of items in each row as 4-byte values, given the item size.
- abstract get_parameter_names()[source]¶
Get the parameter names available from the synapse dynamics components.
- Return type:
iterable(str)
- abstract get_parameters_sdram_usage_in_bytes(n_neurons, n_synapse_types)[source]¶
Get the SDRAM usage of the synapse dynamics parameters in bytes.
- abstract is_same_as(synapse_dynamics)[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics) –
- Return type:
- abstract property pad_to_length¶
The amount each row should pad to, or None if not specified.
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractStaticSynapseDynamics¶
Bases:
AbstractSDRAMSynapseDynamics
Dynamics which don’t change over time.
- abstract get_n_static_words_per_row(ff_size)[source]¶
Get the number of bytes to be read per row for the static data given the size that was written to each row.
- abstract get_n_synapses_in_rows(ff_size)[source]¶
Get the number of synapses in the rows with sizes ff_size.
- abstract get_n_words_for_static_connections(n_connections)[source]¶
Get the number of 32-bit words for n_connections in a single row.
- abstract get_static_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types, max_n_synapses, max_atoms_per_core)[source]¶
Get the fixed-fixed data for each row, and lengths for the fixed-fixed parts of each row.
Data is returned as an array made up of an array of 32-bit words for each row for the fixed-fixed region. The row into which connection should go is given by connection_row_indices, and the total number of rows is given by n_rows.
Lengths are returned as an array made up of an integer for each row, for the fixed-fixed region.
- Parameters:
connections (ndarray) – The connections to get data for
connection_row_indices (ndarray) – The row into which each connection should go
n_rows (int) – The number of rows to write
post_vertex_slice (Slice) – The slice of the post vertex to generate for
n_synapse_types (int) – The number of synapse types
max_n_synapses (int) – The maximum number of synapses to generate
max_atoms_per_core (int) – The maximum number of atoms on a core
- Returns:
(ff_data, ff_size)
- Return type:
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractSupportsSignedWeights¶
Bases:
object
A synapse dynamics object that supports signed weights.
- abstract get_maximum_positive_weight(incoming_projection)[source]¶
Get the maximum likely positive weight.
Note
This must be a value >= 0.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstract get_mean_negative_weight(incoming_projection)[source]¶
Get the mean of the negative weights.
Note
This must be a value <= 0.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstract get_mean_positive_weight(incoming_projection)[source]¶
Get the mean of the positive weights.
Note
This must be a value >= 0.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstract get_minimum_negative_weight(incoming_projection)[source]¶
Get the minimum likely negative weight.
Note
This must be a value <= 0.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstract get_negative_synapse_index(incoming_projection)[source]¶
Get the synapse type that negative weights will arrive at.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstract get_positive_synapse_index(incoming_projection)[source]¶
Get the synapse type that positive weights will arrive at.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstract get_variance_negative_weight(incoming_projection)[source]¶
Get the variance of the negative weights.
Note
This must be a value <= 0.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstract get_variance_positive_weight(incoming_projection)[source]¶
Get the variance of the positive weights.
Note
This must be a value >= 0.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractSynapseDynamics¶
Bases:
object
How do the dynamics of a synapse interact with the rest of the model.
- property absolute_max_atoms_per_core¶
The absolute maximum number of atoms per core supported by this synapse dynamics object.
- Return type:
- get_connected_vertices(s_info, source_vertex, target_vertex)[source]¶
Get the machine vertices that are connected to each other with this connector.
- Parameters:
s_info (SynapseInformation) – The synapse information of the connection
source_vertex (ApplicationVertex) – The source of the spikes
target_vertex (ApplicationVertex) – The target of the spikes
- Returns:
A list of tuples of (target machine vertex, list of sources)
- Return type:
- get_delay_maximum(connector, synapse_info)[source]¶
Get the maximum delay for the synapses.
- Parameters:
connector (AbstractConnector) –
delays (ndarray) –
- get_delay_minimum(connector, synapse_info)[source]¶
Get the minimum delay for the synapses. This will support the filtering of the undelayed edge from the graph, but requires fixes in the synaptic manager to happen first before this can be utilised fully.
- Parameters:
connector (AbstractConnector) – connector
synapse_info (ndarray) – synapse info
- get_delay_variance(connector, delays, synapse_info)[source]¶
Get the variance in delay for the synapses.
- Parameters:
connector (AbstractConnector) –
delays (ndarray) –
- get_provenance_data(pre_population_label, post_population_label)[source]¶
Get the provenance data from this synapse dynamics object.
- get_synapse_id_by_target(target)[source]¶
Get the index of the synapse type based on the name, or None if the name is not found.
- abstract get_vertex_executable_suffix()[source]¶
Get the executable suffix for a vertex for this dynamics.
- Return type:
- get_weight_maximum(connector, synapse_info)[source]¶
Get the maximum weight for the synapses.
- Parameters:
connector (AbstractConnector) –
weights (ndarray) –
- get_weight_mean(connector, synapse_info)[source]¶
Get the mean weight for the synapses.
- Parameters:
connector (AbstractConnector) –
weights (ndarray) –
- get_weight_variance(connector, weights, synapse_info)[source]¶
Get the variance in weight for the synapses.
- Parameters:
connector (AbstractConnector) –
weights (ndarray) –
- abstract property is_combined_core_capable¶
Whether the synapse dynamics can run on a core combined with the neuron, or if a separate core is needed.
- Return type:
- abstract merge(synapse_dynamics)[source]¶
Merge with the given synapse_dynamics and return the result, or error if merge is not possible.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics) –
- Return type:
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractSynapseDynamicsStructural¶
Bases:
object
- abstract check_initial_delay(max_delay_ms)[source]¶
Check that delays can be done without delay extensions.
- abstract property elimination¶
The elimination rule.
- Return type:
- abstract property formation¶
The formation rule.
- Return type:
- abstract get_structural_parameters_sdram_usage_in_bytes(incoming_projections, n_neurons)[source]¶
Get the size of the structural parameters.
Note
At the Application level this will be an estimate.
- Parameters:
incoming_projections (list(Projection)) – The projections that target the vertex in question
n_neurons (int) –
- Returns:
the size of the parameters, in bytes
- Return type:
- Raises:
PacmanInvalidParameterException – If the parameters make no sense.
- abstract property initial_delay¶
The delay of a formed connection.
- abstract property partner_selection¶
The partner selection rule.
- Return type:
- abstract property seed¶
The seed to control the randomness.
- abstract set_connections(connections, post_vertex_slice, app_edge, synapse_info)[source]¶
Set connections for structural plasticity.
- Parameters:
connections (ndarray) –
post_vertex_slice (Slice) –
app_edge (ProjectionApplicationEdge) –
synapse_info (SynapseInformation) –
- abstract property with_replacement¶
Whether to allow replacement when creating synapses.
- Return type:
- abstract write_structural_parameters(spec, region, weight_scales, app_vertex, vertex_slice, synaptic_matrices)[source]¶
Write structural plasticity parameters.
- Parameters:
spec (DataSpecificationGenerator) – The data specification to write to
region (int) – region ID
weight_scales (list(float)) – Weight scaling for each synapse type
app_vertex (ApplicationVertex) – The target application vertex
vertex_slice (Slice) – The slice of the target vertex to generate for
synaptic_matrices (SynapticMatrices) – The synaptic matrices for this vertex
- class spynnaker.pyNN.models.neuron.synapse_dynamics.PyNNSynapseDynamics(slow=None, fast=None)¶
Bases:
object
- property slow¶
- class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsNeuromodulation(weight=0.0, tau_c=1000.0, tau_d=200.0, w_min=0.0, w_max=1.0)¶
Bases:
AbstractPlasticSynapseDynamics
,AbstractGenerateOnMachine
Synapses that target a neuromodulation receptor.
- gen_matrix_params(synaptic_matrix_offset, delayed_matrix_offset, app_edge, synapse_info, max_row_info, max_pre_atoms_per_core, max_post_atoms_per_core)[source]¶
Any parameters required by the matrix generator.
- Return type:
ndarray(uint32)
- property gen_matrix_params_size_in_bytes¶
The size of the parameters of the matrix generator in bytes.
- Return type:
- get_max_synapses(n_words)[source]¶
Get the maximum number of synapses that can be held in the given number of words.
- get_n_fixed_plastic_words_per_row(fp_size)[source]¶
Get the number of fixed plastic words to be read from each row.
- Parameters:
fp_size (ndarray) –
- get_n_plastic_plastic_words_per_row(pp_size)[source]¶
Get the number of plastic plastic words to be read from each row.
- Parameters:
pp_size (ndarray) –
- get_n_synapses_in_rows(pp_size, fp_size)[source]¶
Get the number of synapses in each of the rows with plastic sizes pp_size and fp_size.
- get_n_words_for_plastic_connections(n_connections)[source]¶
Get the number of 32-bit words for n_connections in a single row.
- get_parameter_names()[source]¶
Get the parameter names available from the synapse dynamics components.
- Return type:
iterable(str)
- get_parameters_sdram_usage_in_bytes(n_neurons, n_synapse_types)[source]¶
Get the SDRAM usage of the synapse dynamics parameters in bytes.
- get_plastic_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types, max_n_synapses, max_atoms_per_core)[source]¶
Get the fixed-plastic data, and plastic-plastic data for each row, and lengths for the fixed_plastic and plastic-plastic parts of each row.
Data is returned as an array made up of an array of 32-bit words for each row, for each of the fixed-plastic and plastic-plastic data regions. The row into which connection should go is given by connection_row_indices, and the total number of rows is given by n_rows.
Lengths are returned as an array made up of an integer for each row, for each of the fixed-plastic and plastic-plastic regions.
- Parameters:
connections (ndarray) – The connections to get data for
connection_row_indices (ndarray) – The row into which each connection should go
n_rows (int) – The total number of rows
post_vertex_slice (Slice) – The slice of the post vertex to get the connections for
n_synapse_types (int) – The number of synapse types
max_n_synapses (int) – The maximum number of synapses to generate
max_atoms_per_core (int) – The maximum number of atoms on a core
- Returns:
(fp_data, pp_data, fp_size, pp_size)
- Return type:
- get_synapse_id_by_target(target)[source]¶
Get the index of the synapse type based on the name, or None if the name is not found.
- get_vertex_executable_suffix()[source]¶
Get the executable suffix for a vertex for this dynamics.
- Return type:
- property is_combined_core_capable¶
Whether the synapse dynamics can run on a core combined with the neuron, or if a separate core is needed.
- Return type:
- is_same_as(synapse_dynamics)[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics) –
- Return type:
- merge(synapse_dynamics)[source]¶
Merge with the given synapse_dynamics and return the result, or error if merge is not possible.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics) –
- Return type:
- property pad_to_length¶
The amount each row should pad to, or None if not specified.
- read_plastic_synaptic_data(post_vertex_slice, n_synapse_types, pp_size, pp_data, fp_size, fp_data, max_atoms_per_core)[source]¶
Read the connections indicated in the connection indices from the data in pp_data and fp_data.
- property tau_c¶
- property tau_d¶
- property w_max¶
- property w_min¶
- class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsSTDP(timing_dependence, weight_dependence, voltage_dependence=None, dendritic_delay_fraction=1.0, weight=0.0, delay=None, pad_to_length=None, backprop_delay=True)¶
Bases:
AbstractPlasticSynapseDynamics
,AbstractGenerateOnMachine
The dynamics of a synapse that changes over time using a Spike Timing Dependent Plasticity (STDP) rule.
- Parameters:
timing_dependence (AbstractTimingDependence) –
weight_dependence (AbstractWeightDependence) –
voltage_dependence (None) – not supported
dendritic_delay_fraction (float) – must be 1.0!
weight (float) –
delay (float or None) – Use
None
to get the simulator default minimum delay.pad_to_length (int or None) –
backprop_delay (bool) –
- gen_matrix_params(synaptic_matrix_offset, delayed_matrix_offset, app_edge, synapse_info, max_row_info, max_pre_atoms_per_core, max_post_atoms_per_core)[source]¶
Any parameters required by the matrix generator.
- Return type:
ndarray(uint32)
- property gen_matrix_params_size_in_bytes¶
The size of the parameters of the matrix generator in bytes.
- Return type:
- get_max_synapses(n_words)[source]¶
Get the maximum number of synapses that can be held in the given number of words.
- get_n_fixed_plastic_words_per_row(fp_size)[source]¶
Get the number of fixed plastic words to be read from each row.
- Parameters:
fp_size (ndarray) –
- get_n_plastic_plastic_words_per_row(pp_size)[source]¶
Get the number of plastic plastic words to be read from each row.
- Parameters:
pp_size (ndarray) –
- get_n_synapses_in_rows(pp_size, fp_size)[source]¶
Get the number of synapses in each of the rows with plastic sizes pp_size and fp_size.
- get_parameter_names()[source]¶
Get the parameter names available from the synapse dynamics components.
- Return type:
iterable(str)
- get_plastic_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types, max_n_synapses, max_atoms_per_core)[source]¶
Get the fixed-plastic data, and plastic-plastic data for each row, and lengths for the fixed_plastic and plastic-plastic parts of each row.
Data is returned as an array made up of an array of 32-bit words for each row, for each of the fixed-plastic and plastic-plastic data regions. The row into which connection should go is given by connection_row_indices, and the total number of rows is given by n_rows.
Lengths are returned as an array made up of an integer for each row, for each of the fixed-plastic and plastic-plastic regions.
- Parameters:
connections (ndarray) – The connections to get data for
connection_row_indices (ndarray) – The row into which each connection should go
n_rows (int) – The total number of rows
post_vertex_slice (Slice) – The slice of the post vertex to get the connections for
n_synapse_types (int) – The number of synapse types
max_n_synapses (int) – The maximum number of synapses to generate
max_atoms_per_core (int) – The maximum number of atoms on a core
- Returns:
(fp_data, pp_data, fp_size, pp_size)
- Return type:
- get_weight_maximum(connector, synapse_info)[source]¶
Get the maximum weight for the synapses.
- Parameters:
connector (AbstractConnector) –
weights (ndarray) –
- get_weight_mean(connector, synapse_info)[source]¶
Get the mean weight for the synapses.
- Parameters:
connector (AbstractConnector) –
weights (ndarray) –
- get_weight_variance(connector, weights, synapse_info)[source]¶
Get the variance in weight for the synapses.
- Parameters:
connector (AbstractConnector) –
weights (ndarray) –
- property is_combined_core_capable¶
Whether the synapse dynamics can run on a core combined with the neuron, or if a separate core is needed.
- Return type:
- is_same_as(synapse_dynamics)[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics) –
- Return type:
- merge(synapse_dynamics)[source]¶
Merge with the given synapse_dynamics and return the result, or error if merge is not possible.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics) –
- Return type:
- property neuromodulation¶
- Return type:
- property pad_to_length¶
The amount each row should pad to, or None if not specified.
- read_plastic_synaptic_data(post_vertex_slice, n_synapse_types, pp_size, pp_data, fp_size, fp_data, max_atoms_per_core)[source]¶
Read the connections indicated in the connection indices from the data in pp_data and fp_data.
- property timing_dependence¶
- Return type:
- property weight_dependence¶
- Return type:
- class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsStatic(weight=0.0, delay=None, pad_to_length=None)¶
Bases:
AbstractStaticSynapseDynamics
,AbstractGenerateOnMachine
The dynamics of a synapse that does not change over time.
- Parameters:
- gen_matrix_params(synaptic_matrix_offset, delayed_matrix_offset, app_edge, synapse_info, max_row_info, max_pre_atoms_per_core, max_post_atoms_per_core)[source]¶
Any parameters required by the matrix generator.
- Return type:
ndarray(uint32)
- property gen_matrix_params_size_in_bytes¶
The size of the parameters of the matrix generator in bytes.
- Return type:
- get_max_synapses(n_words)[source]¶
Get the maximum number of synapses that can be held in the given number of words.
- get_n_static_words_per_row(ff_size)[source]¶
Get the number of bytes to be read per row for the static data given the size that was written to each row.
- get_n_words_for_static_connections(n_connections)[source]¶
Get the number of 32-bit words for n_connections in a single row.
- get_parameter_names()[source]¶
Get the parameter names available from the synapse dynamics components.
- Return type:
iterable(str)
- get_parameters_sdram_usage_in_bytes(n_neurons, n_synapse_types)[source]¶
Get the SDRAM usage of the synapse dynamics parameters in bytes.
- get_static_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types, max_n_synapses, max_atoms_per_core)[source]¶
Get the fixed-fixed data for each row, and lengths for the fixed-fixed parts of each row.
Data is returned as an array made up of an array of 32-bit words for each row for the fixed-fixed region. The row into which connection should go is given by connection_row_indices, and the total number of rows is given by n_rows.
Lengths are returned as an array made up of an integer for each row, for the fixed-fixed region.
- Parameters:
connections (ndarray) – The connections to get data for
connection_row_indices (ndarray) – The row into which each connection should go
n_rows (int) – The number of rows to write
post_vertex_slice (Slice) – The slice of the post vertex to generate for
n_synapse_types (int) – The number of synapse types
max_n_synapses (int) – The maximum number of synapses to generate
max_atoms_per_core (int) – The maximum number of atoms on a core
- Returns:
(ff_data, ff_size)
- Return type:
- get_vertex_executable_suffix()[source]¶
Get the executable suffix for a vertex for this dynamics.
- Return type:
- property is_combined_core_capable¶
Whether the synapse dynamics can run on a core combined with the neuron, or if a separate core is needed.
- Return type:
- is_same_as(synapse_dynamics)[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics) –
- Return type:
- merge(synapse_dynamics)[source]¶
Merge with the given synapse_dynamics and return the result, or error if merge is not possible.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics) –
- Return type:
- property pad_to_length¶
The amount each row should pad to, or None if not specified.
- read_static_synaptic_data(post_vertex_slice, n_synapse_types, ff_size, ff_data, max_atoms_per_core)[source]¶
Read the connections from the words of data in ff_data.
- class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsStructuralCommon¶
Bases:
AbstractSynapseDynamicsStructural
- PAIR_ERROR = 'Only one Projection between each pair of Populations can use structural plasticity'¶
- check_initial_delay(max_delay_ms)[source]¶
Check that delays can be done without delay extensions.
- Parameters:
max_delay_ms (float) – The maximum delay supported, in milliseconds
- Raises:
ValueError – if the delay is out of range
- abstract get_seeds(app_vertex=None)[source]¶
Generate a seed for the RNG on chip that is the same for all of the cores that have perform structural updates.
It should be different between application vertices but the same for the same app_vertex. It should be different every time called with None.
- Parameters:
app_vertex (ApplicationVertex or None) –
- Returns:
list of random seed (4 words), generated randomly
- Return type:
- get_structural_parameters_sdram_usage_in_bytes(incoming_projections, n_neurons)[source]¶
Get the size of the structural parameters.
Note
At the Application level this will be an estimate.
- Parameters:
incoming_projections (list(Projection)) – The projections that target the vertex in question
n_neurons (int) –
- Returns:
the size of the parameters, in bytes
- Return type:
- Raises:
PacmanInvalidParameterException – If the parameters make no sense.
- is_same_as(synapse_dynamics)[source]¶
- Parameters:
synapse_dynamics (SynapseDynamicsStructuralCommon) –
- Return type:
- write_structural_parameters(spec, region, weight_scales, app_vertex, vertex_slice, synaptic_matrices)[source]¶
Write structural plasticity parameters.
- Parameters:
spec (DataSpecificationGenerator) – The data specification to write to
region (int) – region ID
weight_scales (list(float)) – Weight scaling for each synapse type
app_vertex (ApplicationVertex) – The target application vertex
vertex_slice (Slice) – The slice of the target vertex to generate for
synaptic_matrices (SynapticMatrices) – The synaptic matrices for this vertex
- class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsStructuralSTDP(partner_selection, formation, elimination, timing_dependence=None, weight_dependence=None, voltage_dependence=None, dendritic_delay_fraction=1.0, f_rew=10000.0, initial_weight=0.0, initial_delay=1.0, s_max=32, with_replacement=True, seed=None, weight=0.0, delay=None, backprop_delay=True)¶
Bases:
SynapseDynamicsSTDP
,SynapseDynamicsStructuralCommon
Class that enables synaptic rewiring in the presence of STDP.
It acts as a wrapper around SynapseDynamicsSTDP, meaning rewiring can operate in parallel with STDP synapses.
Written by Petrut Bogdan.
- Parameters:
partner_selection (AbstractPartnerSelection) – The partner selection rule
formation (AbstractFormation) – The formation rule
elimination (AbstractElimination) – The elimination rule
timing_dependence (AbstractTimingDependence) – The STDP timing dependence rule
weight_dependence (AbstractWeightDependence) – The STDP weight dependence rule
voltage_dependence (None) – The STDP voltage dependence (unsupported)
dendritic_delay_fraction (float) – The STDP dendritic delay fraction
f_rew (float) – How many rewiring attempts will be done per second.
initial_weight (float) – Weight assigned to a newly formed connection
initial_delay (float or tuple(float, float)) – Delay assigned to a newly formed connection; a single value means a fixed delay value, or a tuple of two values means the delay will be chosen at random from a uniform distribution between the given values
s_max (int) – Maximum fan-in per target layer neuron
with_replacement (bool) – If set to True (default), a new synapse can be formed in a location where a connection already exists; if False, then it must form where no connection already exists
seed (int or None) – seed for the random number generators
weight (float) – The weight of connections formed by the connector
delay (float or None) – The delay of connections formed by the connector Use
None
to get the simulator default minimum delay.backprop_delay (bool) – Whether back-propagated delays are used
- property elimination¶
The elimination rule.
- Return type:
- property formation¶
The formation rule.
- Return type:
- generate_on_machine()[source]¶
Determines if this instance should be generated on the machine.
Default implementation returns True
- Return type:
- get_connected_vertices(s_info, source_vertex, target_vertex)[source]¶
Get the machine vertices that are connected to each other with this connector.
- Parameters:
s_info (SynapseInformation) – The synapse information of the connection
source_vertex (ApplicationVertex) – The source of the spikes
target_vertex (ApplicationVertex) – The target of the spikes
- Returns:
A list of tuples of (target machine vertex, list of sources)
- Return type:
- get_delay_maximum(connector, synapse_info)[source]¶
Get the maximum delay for the synapses.
- Parameters:
connector (AbstractConnector) –
delays (ndarray) –
- get_delay_minimum(connector, synapse_info)[source]¶
Get the minimum delay for the synapses. This will support the filtering of the undelayed edge from the graph, but requires fixes in the synaptic manager to happen first before this can be utilised fully.
- Parameters:
connector (AbstractConnector) – connector
synapse_info (ndarray) – synapse info
- get_delay_variance(connector, delays, synapse_info)[source]¶
Get the variance in delay for the synapses.
- Parameters:
connector (AbstractConnector) –
delays (ndarray) –
- get_parameter_names()[source]¶
Get the parameter names available from the synapse dynamics components.
- Return type:
iterable(str)
- get_seeds(app_vertex=None)[source]¶
Generate a seed for the RNG on chip that is the same for all of the cores that have perform structural updates.
It should be different between application vertices but the same for the same app_vertex. It should be different every time called with None.
- Parameters:
app_vertex (ApplicationVertex or None) –
- Returns:
list of random seed (4 words), generated randomly
- Return type:
- get_weight_maximum(connector, synapse_info)[source]¶
Get the maximum weight for the synapses.
- Parameters:
connector (AbstractConnector) –
weights (ndarray) –
- get_weight_mean(connector, synapse_info)[source]¶
Get the mean weight for the synapses.
- Parameters:
connector (AbstractConnector) –
weights (ndarray) –
- property is_combined_core_capable¶
Whether the synapse dynamics can run on a core combined with the neuron, or if a separate core is needed.
- Return type:
- is_same_as(synapse_dynamics)[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics) –
- Return type:
- merge(synapse_dynamics)[source]¶
Merge with the given synapse_dynamics and return the result, or error if merge is not possible.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics) –
- Return type:
- property partner_selection¶
The partner selection rule.
- Return type:
- property seed¶
The seed to control the randomness.
- set_connections(connections, post_vertex_slice, app_edge, synapse_info)[source]¶
Set connections for structural plasticity.
- Parameters:
connections (ndarray) –
post_vertex_slice (Slice) –
app_edge (ProjectionApplicationEdge) –
synapse_info (SynapseInformation) –
- class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsStructuralStatic(partner_selection, formation, elimination, f_rew=10000.0, initial_weight=0.0, initial_delay=1.0, s_max=32, with_replacement=True, seed=None, weight=0.0, delay=None)¶
Bases:
SynapseDynamicsStatic
,SynapseDynamicsStructuralCommon
Class that enables synaptic rewiring in the absence of STDP.
It acts as a wrapper around SynapseDynamicsStatic, meaning that rewiring can operate in parallel with static synapses.
Written by Petrut Bogdan.
- Parameters:
partner_selection (AbstractPartnerSelection) – The partner selection rule
formation (AbstractFormation) – The formation rule
elimination (AbstractElimination) – The elimination rule
f_rew (float) – How many rewiring attempts will be done per second.
initial_weight (float) – Weight assigned to a newly formed connection
initial_delay (float or (float, float)) – Delay assigned to a newly formed connection; a single value means a fixed delay value, or a tuple of two values means the delay will be chosen at random from a uniform distribution between the given values
s_max (int) – Maximum fan-in per target layer neuron
with_replacement (bool) – If set to True (default), a new synapse can be formed in a location where a connection already exists; if False, then it must form where no connection already exists
seed (int) – seed the random number generators
weight (float) – The weight of connections formed by the connector
delay (float or None) – The delay of connections formed by the connector Use
None
to get the simulator default minimum delay.
- property elimination¶
The elimination rule.
- Return type:
- property formation¶
The formation rule.
- Return type:
- generate_on_machine()[source]¶
Determines if this instance should be generated on the machine.
Default implementation returns True
- Return type:
- get_connected_vertices(s_info, source_vertex, target_vertex)[source]¶
Get the machine vertices that are connected to each other with this connector.
- Parameters:
s_info (SynapseInformation) – The synapse information of the connection
source_vertex (ApplicationVertex) – The source of the spikes
target_vertex (ApplicationVertex) – The target of the spikes
- Returns:
A list of tuples of (target machine vertex, list of sources)
- Return type:
- get_delay_maximum(connector, synapse_info)[source]¶
Get the maximum delay for the synapses.
- Parameters:
connector (AbstractConnector) –
delays (ndarray) –
- get_delay_minimum(connector, synapse_info)[source]¶
Get the minimum delay for the synapses. This will support the filtering of the undelayed edge from the graph, but requires fixes in the synaptic manager to happen first before this can be utilised fully.
- Parameters:
connector (AbstractConnector) – connector
synapse_info (ndarray) – synapse info
- get_delay_variance(connector, delays, synapse_info)[source]¶
Get the variance in delay for the synapses.
- Parameters:
connector (AbstractConnector) –
delays (ndarray) –
- get_parameter_names()[source]¶
Get the parameter names available from the synapse dynamics components.
- Return type:
iterable(str)
- get_seeds(app_vertex=None)[source]¶
Generate a seed for the RNG on chip that is the same for all of the cores that have perform structural updates.
It should be different between application vertices but the same for the same app_vertex. It should be different every time called with None.
- Parameters:
app_vertex (ApplicationVertex or None) –
- Returns:
list of random seed (4 words), generated randomly
- Return type:
- get_vertex_executable_suffix()[source]¶
Get the executable suffix for a vertex for this dynamics.
- Return type:
- get_weight_maximum(connector, synapse_info)[source]¶
Get the maximum weight for the synapses.
- Parameters:
connector (AbstractConnector) –
weights (ndarray) –
- get_weight_mean(connector, synapse_info)[source]¶
Get the mean weight for the synapses.
- Parameters:
connector (AbstractConnector) –
weights (ndarray) –
- get_weight_variance(connector, weights, synapse_info)[source]¶
Get the variance in weight for the synapses.
- Parameters:
connector (AbstractConnector) –
weights (ndarray) –
- property is_combined_core_capable¶
Whether the synapse dynamics can run on a core combined with the neuron, or if a separate core is needed.
- Return type:
- is_same_as(synapse_dynamics)[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics) –
- Return type:
- merge(synapse_dynamics)[source]¶
Merge with the given synapse_dynamics and return the result, or error if merge is not possible.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics) –
- Return type:
- property partner_selection¶
The partner selection rule.
- Return type:
- property seed¶
The seed to control the randomness.
- set_connections(connections, post_vertex_slice, app_edge, synapse_info)[source]¶
Set connections for structural plasticity.
- Parameters:
connections (ndarray) –
post_vertex_slice (Slice) –
app_edge (ProjectionApplicationEdge) –
synapse_info (SynapseInformation) –
- spynnaker.pyNN.models.neuron.synapse_dynamics.calculate_spike_pair_additive_stdp_weight(pre_spikes, post_spikes, initial_weight, plastic_delay, a_plus, a_minus, tau_plus, tau_minus)¶
Calculates the expected STDP weight for SpikePair Additive STDP.
- Parameters:
pre_spikes (iterable(int)) –
post_spikes (iterable(int)) –
initial_weight (float) –
plastic_delay (int) – parameter of the STDP model
a_plus (float) – parameter of the STDP model
a_minus (float) – parameter of the STDP model
tau_plus (float) – parameter of the STDP model
tau_minus (float) – parameter of the STDP model
- Returns:
overall weight
- Return type:
- spynnaker.pyNN.models.neuron.synapse_dynamics.calculate_spike_pair_multiplicative_stdp_weight(pre_spikes, post_spikes, initial_weight, plastic_delay, min_weight, max_weight, a_plus, a_minus, tau_plus, tau_minus)¶
Calculates the expected STDP weight for SpikePair Multiplicative STDP.
- Parameters:
pre_spikes (iterable(int)) – Spikes going into the model
post_spikes (iterable(int)) – Spikes recorded on the model
initial_weight (float) – Starting weight for the model
plastic_delay (int) – parameter of the STDP model
min_weight (float) – parameter of the STDP model
max_weight (float) – parameter of the STDP model
a_plus (float) – parameter of the STDP model
a_minus (float) – parameter of the STDP model
tau_plus (float) – parameter of the STDP model
tau_minus (float) – parameter of the STDP model
- Returns:
overall weight
- Return type: