spynnaker.pyNN.models.neuron.synapse_dynamics package¶
Module contents¶
-
class
spynnaker.pyNN.models.neuron.synapse_dynamics.
AbstractGenerateOnMachine
[source]¶ Bases:
object
A synapse dynamics that can be generated on the machine.
-
class
spynnaker.pyNN.models.neuron.synapse_dynamics.
AbstractPlasticSynapseDynamics
[source]¶ Bases:
spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_synapse_dynamics.AbstractSynapseDynamics
Synapses which change over time
-
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.
Parameters:
-
get_n_words_for_plastic_connections
(n_connections)[source]¶ Get the number of 32-bit words for n_connections in a single row.
Parameters: n_connections (int) – Return type: int
-
get_plastic_synaptic_data
(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types, max_n_synapses)[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
Returns: (fp_data, pp_data, fp_size, pp_size)
Return type:
-
-
class
spynnaker.pyNN.models.neuron.synapse_dynamics.
AbstractStaticSynapseDynamics
[source]¶ Bases:
spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_synapse_dynamics.AbstractSynapseDynamics
Dynamics which don’t change over time.
-
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.
Parameters: ff_size (ndarray) – Return type: ndarray
-
get_n_synapses_in_rows
(ff_size)[source]¶ Get the number of synapses in the rows with sizes ff_size.
Parameters: ff_size (ndarray) – Return type: ndarray
-
get_n_words_for_static_connections
(n_connections)[source]¶ Get the number of 32-bit words for n_connections in a single row.
Parameters: n_connections (int) – Return type: int
-
get_static_synaptic_data
(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types, max_n_synapses)[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
Returns: (ff_data, ff_size)
Return type:
-
-
class
spynnaker.pyNN.models.neuron.synapse_dynamics.
AbstractSynapseDynamics
[source]¶ Bases:
object
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')]¶ Type model of the basic configuration data of a connector
-
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
Parameters: Return type:
-
delay
¶ The delay of connections
-
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_max_synapses
(n_words)[source]¶ Get the maximum number of synapses that can be held in the given number of words
Parameters: n_words (int) – The number of words the synapses must fit in Return type: int
-
get_n_items
(rows, item_size)[source]¶ Get the number of items in each row as 4-byte values, given the item size
Parameters: Return type:
-
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
Parameters: 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.
Parameters: target (str) – The name of the synapse Return type: int or None
-
get_vertex_executable_suffix
()[source]¶ Get the executable suffix for a vertex for this dynamics
Return type: str
-
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) –
-
get_words
(rows)[source]¶ Convert the row data to words
Parameters: rows (ndarray) – Return type: ndarray
-
is_same_as
(synapse_dynamics)[source]¶ Determines if this synapse dynamics is the same as another
Parameters: synapse_dynamics (AbstractSynapseDynamics) – Return type: bool
-
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: AbstractSynapseDynamics
-
pad_to_length
¶ The amount each row should pad to, or None if not specified
-
weight
¶ The weight of connections
-
write_parameters
(spec, region, global_weight_scale, synapse_weight_scales)[source]¶ Write the synapse parameters to the spec
Parameters: - spec (DataSpecificationGenerator) – The specification to write to
- region (int) – region ID to write to
- global_weight_scale (float) – The weight scale applied globally
- synapse_weight_scales (list(float)) – The total weight scale applied to each synapse including the global weight scale
-
-
class
spynnaker.pyNN.models.neuron.synapse_dynamics.
AbstractSynapseDynamicsStructural
[source]¶ Bases:
object
-
check_initial_delay
(max_delay_ms)[source]¶ Check that delays can be done without delay extensions
Parameters: max_delay_ms (int) – The maximum delay supported, in milliseconds Raises: Exception – if the delay is out of range
-
elimination
¶ The elimination rule
Return type: AbstractElimination
-
formation
¶ The formation rule
Return type: AbstractFormation
-
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: Returns: the size of the parameters, in bytes
Return type: Raises:
-
partner_selection
¶ The partner selection rule
Return type: AbstractPartnerSelection
-
seed
¶ The seed to control the randomness
-
set_connections
(connections, post_vertex_slice, app_edge, synapse_info, machine_edge)[source]¶ Set connections for structural plasticity
Parameters: - connections (ndarray) –
- post_vertex_slice (Slice) –
- app_edge (ProjectionApplicationEdge) –
- synapse_info (SynapseInformation) –
- machine_edge (MachineEdge) –
-
write_structural_parameters
(spec, region, weight_scales, app_vertex, vertex_slice, routing_info, 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
- routing_info (RoutingInfo) – Routing information for all edges
- synaptic_matrices (SynapticMatrices) – The synaptic matrices for this vertex
-
-
spynnaker.pyNN.models.neuron.synapse_dynamics.
calculate_spike_pair_additive_stdp_weight
(pre_spikes, post_spikes, initial_weight, plastic_delay, max_weight, a_plus, a_minus, tau_plus, tau_minus)[source]¶ Calculates the expected stdp weight for SpikePair Additive STDP
Parameters: - pre_spikes –
- post_spikes –
- initial_weight –
- plastic_delay –
- max_weight –
- a_plus –
- a_minus –
- tau_plus –
- tau_minus –
Returns:
-
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)[source]¶ 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) – param of the stdp model
- min_weight (float) – param of the stdp model
- max_weight (float) – param of the stdp model
- a_plus (float) – param of the stdp model
- a_minus (float) – param of the stdp model
- tau_plus (float) – param of the stdp model
- tau_minus (float) – param of the stdp model
Returns:
-
class
spynnaker.pyNN.models.neuron.synapse_dynamics.
PyNNSynapseDynamics
(slow=None, fast=None)[source]¶ Bases:
object
-
slow
¶
-
-
class
spynnaker.pyNN.models.neuron.synapse_dynamics.
SynapseDynamicsStatic
(weight=0.0, delay=None, pad_to_length=None)[source]¶ Bases:
spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_static_synapse_dynamics.AbstractStaticSynapseDynamics
,spynnaker.pyNN.models.abstract_models.abstract_settable.AbstractSettable
,spinn_front_end_common.abstract_models.abstract_changable_after_run.AbstractChangableAfterRun
,spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_generate_on_machine.AbstractGenerateOnMachine
The dynamics of a synapse that does not change over time.
Parameters: -
delay
¶ The delay of connections
-
get_max_synapses
(n_words)[source]¶ Get the maximum number of synapses that can be held in the given number of words
Parameters: n_words (int) – The number of words the synapses must fit in Return type: int
-
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.
Parameters: ff_size (ndarray) – Return type: ndarray
-
get_n_synapses_in_rows
(ff_size)[source]¶ Get the number of synapses in the rows with sizes ff_size.
Parameters: ff_size (ndarray) – Return type: ndarray
-
get_n_words_for_static_connections
(n_connections)[source]¶ Get the number of 32-bit words for n_connections in a single row.
Parameters: n_connections (int) – Return type: int
-
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
Parameters: Return type:
-
get_static_synaptic_data
(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types, max_n_synapses)[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
Returns: (ff_data, ff_size)
Return type:
-
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)
-
get_vertex_executable_suffix
()[source]¶ Get the executable suffix for a vertex for this dynamics
Return type: str
-
is_same_as
(synapse_dynamics)[source]¶ Determines if this synapse dynamics is the same as another
Parameters: synapse_dynamics (AbstractSynapseDynamics) – Return type: bool
-
mark_no_changes
()[source]¶ Marks the point after which changes are reported. Immediately after calling this method, requires_mapping should return False.
-
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: AbstractSynapseDynamics
-
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)[source]¶ Read the connections from the words of data in ff_data.
Parameters:
-
requires_mapping
¶ True if changes that have been made require that mapping be performed. Note that this should return True the first time it is called, as the vertex must require mapping as it has been created!
-
weight
¶ The weight of connections
-
write_parameters
(spec, region, global_weight_scale, synapse_weight_scales)[source]¶ Write the synapse parameters to the spec
Parameters: - spec (DataSpecificationGenerator) – The specification to write to
- region (int) – region ID to write to
- global_weight_scale (float) – The weight scale applied globally
- synapse_weight_scales (list(float)) – The total weight scale applied to each synapse including the global weight scale
-
-
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)[source]¶ Bases:
spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_plastic_synapse_dynamics.AbstractPlasticSynapseDynamics
,spynnaker.pyNN.models.abstract_models.abstract_settable.AbstractSettable
,spinn_front_end_common.abstract_models.abstract_changable_after_run.AbstractChangableAfterRun
,spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_generate_on_machine.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) –
-
delay
¶ The delay of connections
-
gen_matrix_params_size_in_bytes
¶ The size of the parameters of the matrix generator in bytes.
Return type: int
-
get_max_synapses
(n_words)[source]¶ Get the maximum number of synapses that can be held in the given number of words
Parameters: n_words (int) – The number of words the synapses must fit in Return type: int
-
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.
Parameters:
-
get_n_words_for_plastic_connections
(n_connections)[source]¶ Parameters: n_connections (int) – Return type: int
-
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)[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
Returns: (fp_data, pp_data, fp_size, pp_size)
Return type:
-
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)
-
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) –
-
is_same_as
(synapse_dynamics)[source]¶ Determines if this synapse dynamics is the same as another
Parameters: synapse_dynamics (AbstractSynapseDynamics) – Return type: bool
-
mark_no_changes
()[source]¶ Marks the point after which changes are reported. Immediately after calling this method, requires_mapping should return False.
-
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: AbstractSynapseDynamics
-
neuromodulation
¶ Return type: SynapseDynamicsNeuromodulation
-
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)[source]¶ Read the connections indicated in the connection indices from the data in pp_data and fp_data.
Parameters: Returns: array with columns
source
,target
,weight
,delay
Return type:
-
requires_mapping
¶ True if changes that have been made require that mapping be performed. Note that this should return True the first time it is called, as the vertex must require mapping as it has been created!
-
timing_dependence
¶ Return type: AbstractTimingDependence
-
weight
¶ The weight of connections
-
weight_dependence
¶ Return type: AbstractTimingDependence
-
write_parameters
(spec, region, global_weight_scale, synapse_weight_scales)[source]¶ Write the synapse parameters to the spec
Parameters: - spec (DataSpecificationGenerator) – The specification to write to
- region (int) – region ID to write to
- global_weight_scale (float) – The weight scale applied globally
- synapse_weight_scales (list(float)) – The total weight scale applied to each synapse including the global weight scale
-
class
spynnaker.pyNN.models.neuron.synapse_dynamics.
SynapseDynamicsStructuralCommon
[source]¶ Bases:
spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_synapse_dynamics_structural.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: Exception – if the delay is out of range
-
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: list(int)
-
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: Returns: the size of the parameters, in bytes
Return type: Raises:
-
is_same_as
(synapse_dynamics)[source]¶ Parameters: synapse_dynamics (SynapseDynamicsStructuralCommon) – Return type: bool
-
write_structural_parameters
(spec, region, weight_scales, app_vertex, vertex_slice, routing_info, 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
- routing_info (RoutingInfo) – Routing information for all edges
- synaptic_matrices (SynapticMatrices) – The synaptic matrices for this vertex
-
-
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)[source]¶ Bases:
spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_static.SynapseDynamicsStatic
,spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_structural_common.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.
-
elimination
¶ The elimination rule
Return type: AbstractElimination
-
formation
¶ The formation rule
Return type: AbstractFormation
-
generate_on_machine
()[source]¶ Determines if this instance should be generated on the machine.
Default implementation returns True
Return type: bool
-
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_n_words_for_static_connections
(n_connections)[source]¶ Get the number of 32-bit words for n_connections in a single row.
Parameters: n_connections (int) – Return type: int
-
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: list(int)
-
get_vertex_executable_suffix
()[source]¶ Get the executable suffix for a vertex for this dynamics
Return type: str
-
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) –
-
is_same_as
(synapse_dynamics)[source]¶ Determines if this synapse dynamics is the same as another
Parameters: synapse_dynamics (AbstractSynapseDynamics) – Return type: bool
-
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: AbstractSynapseDynamics
-
partner_selection
¶ The partner selection rule
Return type: AbstractPartnerSelection
-
seed
¶ The seed to control the randomness
-
set_connections
(connections, post_vertex_slice, app_edge, synapse_info, machine_edge)[source]¶ Set connections for structural plasticity
Parameters: - connections (ndarray) –
- post_vertex_slice (Slice) –
- app_edge (ProjectionApplicationEdge) –
- synapse_info (SynapseInformation) –
- machine_edge (MachineEdge) –
-
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)[source]¶ Bases:
spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_stdp.SynapseDynamicsSTDP
,spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_structural_common.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
-
elimination
¶ The elimination rule
Return type: AbstractElimination
-
formation
¶ The formation rule
Return type: AbstractFormation
-
generate_on_machine
()[source]¶ Determines if this instance should be generated on the machine.
Default implementation returns True
Return type: bool
-
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_n_words_for_plastic_connections
(n_connections)[source]¶ Parameters: n_connections (int) – Return type: int
-
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: list(int)
-
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) –
-
is_same_as
(synapse_dynamics)[source]¶ Determines if this synapse dynamics is the same as another
Parameters: synapse_dynamics (AbstractSynapseDynamics) – Return type: bool
-
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: AbstractSynapseDynamics
-
partner_selection
¶ The partner selection rule
Return type: AbstractPartnerSelection
-
seed
¶ The seed to control the randomness
-
set_connections
(connections, post_vertex_slice, app_edge, synapse_info, machine_edge)[source]¶ Set connections for structural plasticity
Parameters: - connections (ndarray) –
- post_vertex_slice (Slice) –
- app_edge (ProjectionApplicationEdge) –
- synapse_info (SynapseInformation) –
- machine_edge (MachineEdge) –
-
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)[source]¶ Bases:
spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_plastic_synapse_dynamics.AbstractPlasticSynapseDynamics
Synapses that target a neuromodulation receptor
-
delay
¶ The delay of connections
-
gen_matrix_params_size_in_bytes
¶ The size of the parameters of the matrix generator in bytes.
Return type: int
-
get_max_synapses
(n_words)[source]¶ Get the maximum number of synapses that can be held in the given number of words
Parameters: n_words (int) – The number of words the synapses must fit in Return type: int
-
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.
Parameters:
-
get_n_words_for_plastic_connections
(n_connections)[source]¶ Get the number of 32-bit words for n_connections in a single row.
Parameters: n_connections (int) – Return type: int
-
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
Parameters: Return type:
-
get_plastic_synaptic_data
(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types, max_n_synapses)[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
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.
Parameters: target (str) – The name of the synapse Return type: int or None
-
get_vertex_executable_suffix
()[source]¶ Get the executable suffix for a vertex for this dynamics
Return type: str
-
is_same_as
(synapse_dynamics)[source]¶ Determines if this synapse dynamics is the same as another
Parameters: synapse_dynamics (AbstractSynapseDynamics) – Return type: bool
-
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: AbstractSynapseDynamics
-
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)[source]¶ Read the connections indicated in the connection indices from the data in pp_data and fp_data.
Parameters: Returns: array with columns
source
,target
,weight
,delay
Return type:
-
tau_c
¶
-
tau_d
¶
-
w_max
¶
-
w_min
¶
-
weight
¶ The weight of connections
-
write_parameters
(spec, region, global_weight_scale, synapse_weight_scales)[source]¶ Write the synapse parameters to the spec
Parameters: - spec (DataSpecificationGenerator) – The specification to write to
- region (int) – region ID to write to
- global_weight_scale (float) – The weight scale applied globally
- synapse_weight_scales (list(float)) – The total weight scale applied to each synapse including the global weight scale
-