spynnaker.pyNN.models.neuron.synapse_dynamics package¶
Submodules¶
spynnaker.pyNN.models.neuron.synapse_dynamics.types module¶
- spynnaker.pyNN.models.neuron.synapse_dynamics.types.ConnectionsArray¶
Type of connections. The dtype is actually
NUMPY_CONNECTORS_DTYPEbut we cannot currently express that in the overall array type due to Numpy typing limitations.
Module contents¶
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractGenerateOnMachine¶
Bases:
objectA synapse dynamics that can be generated on the machine.
- abstractmethod gen_matrix_params(synaptic_matrix_offset: int, delayed_matrix_offset: int, app_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation, max_row_info: MaxRowInfo, max_pre_atoms_per_core: int, max_post_atoms_per_core: int) NDArray[uint32][source]¶
Any parameters required by the matrix generator.
- Return type:
ndarray(uint32)
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractHasParameterNames¶
Bases:
objectA component that has parameter names. Parameter names are usually properties of the component, and are frequently also settable by named parameter when making the component.
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractPlasticSynapseDynamics(delay: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None, weight: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None)¶
Bases:
AbstractSDRAMSynapseDynamicsSynapses which change over time.
- abstractmethod get_n_fixed_plastic_words_per_row(fp_size: ndarray[tuple[int, ...], dtype[uint32]]) ndarray[tuple[int, ...], dtype[integer]][source]¶
Get the number of fixed plastic words to be read from each row.
- Parameters:
fp_size (ndarray)
- abstractmethod get_n_plastic_plastic_words_per_row(pp_size: ndarray[tuple[int, ...], dtype[uint32]]) ndarray[tuple[int, ...], dtype[integer]][source]¶
Get the number of plastic plastic words to be read from each row.
- Parameters:
pp_size (ndarray)
- abstractmethod get_n_synapses_in_rows(pp_size: ndarray[tuple[int, ...], dtype[uint32]], fp_size: ndarray[tuple[int, ...], dtype[uint32]]) ndarray[tuple[int, ...], dtype[integer]][source]¶
Get the number of synapses in each of the rows with plastic sizes pp_size and fp_size.
- abstractmethod get_n_words_for_plastic_connections(n_connections: int) int[source]¶
Get the number of 32-bit words for n_connections in a single row.
- abstractmethod get_plastic_synaptic_data(connections: ndarray[tuple[int, ...], dtype[void]], connection_row_indices: ndarray[tuple[int, ...], dtype[integer]], n_rows: int, n_synapse_types: int, max_n_synapses: int, max_atoms_per_core: int) Tuple[ndarray[tuple[int, ...], dtype[uint32]], ndarray[tuple[int, ...], dtype[uint32]], ndarray[tuple[int, ...], dtype[uint32]], ndarray[tuple[int, ...], dtype[uint32]]] | Tuple[List[ndarray[tuple[int, ...], dtype[uint32]]], List[ndarray[tuple[int, ...], dtype[uint32]]], ndarray[tuple[int, ...], dtype[uint32]], ndarray[tuple[int, ...], dtype[uint32]]][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
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 (2D), pp_data (2D), fp_size (1D), pp_size (1D))
- Return type:
- abstractmethod read_plastic_synaptic_data(n_synapse_types: int, pp_size: ndarray[tuple[int, ...], dtype[uint32]], pp_data: List[ndarray[tuple[int, ...], dtype[uint32]]], fp_size: ndarray[tuple[int, ...], dtype[uint32]], fp_data: List[ndarray[tuple[int, ...], dtype[uint32]]], max_atoms_per_core: int) ndarray[tuple[int, ...], dtype[void]][source]¶
Read the connections indicated in the connection indices from the data in pp_data and fp_data.
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractSDRAMSynapseDynamics(delay: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None, weight: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None)¶
Bases:
AbstractSynapseDynamics,AbstractHasParameterNamesHow do the dynamics of a synapse interact with the rest of the model.
- convert_per_connection_data_to_rows(connection_row_indices: ndarray[tuple[int, ...], dtype[integer]], n_rows: int, data: ndarray[tuple[int, ...], dtype[_ScalarType_co]], max_n_synapses: int) List[ndarray[tuple[int, ...], dtype[_ScalarType_co]]][source]¶
Converts per-connection data generated from connections into row-based data to be returned from get_synaptic_data.
- abstractmethod get_max_synapses(n_words: int) int[source]¶
Get the maximum number of synapses that can be held in the given number of words.
- get_n_items(rows: List[ndarray[tuple[int, ...], dtype[_ScalarType_co]]], item_size: int) ndarray[tuple[int, ...], dtype[uint32]][source]¶
Get the number of items in each row as 4-byte values, given the item size.
- abstractmethod get_parameters_sdram_usage_in_bytes(n_neurons: int, n_synapse_types: int) int[source]¶
Get the SDRAM usage of the synapse dynamics parameters in bytes.
- get_words(rows: List[ndarray[tuple[int, ...], dtype[_ScalarType_co]]]) List[ndarray[tuple[int, ...], dtype[uint32]]][source]¶
Convert the row data to words.
- abstractmethod is_same_as(synapse_dynamics: AbstractSynapseDynamics) bool[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics)
- Return type:
- abstract property pad_to_length: int | None¶
The amount each row should pad to, or None if not specified.
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractStaticSynapseDynamics(delay: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None, weight: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None)¶
Bases:
AbstractSDRAMSynapseDynamicsDynamics which don’t change over time.
- abstractmethod get_n_static_words_per_row(ff_size: ndarray[tuple[int, ...], dtype[integer]]) ndarray[tuple[int, ...], dtype[integer]][source]¶
Get the number of bytes to be read per row for the static data given the size that was written to each row.
- abstractmethod get_n_synapses_in_rows(ff_size: ndarray[tuple[int, ...], dtype[integer]]) ndarray[tuple[int, ...], dtype[integer]][source]¶
Get the number of synapses in the rows with sizes ff_size.
- abstractmethod get_n_words_for_static_connections(n_connections: int) int[source]¶
Get the number of 32-bit words for n_connections in a single row.
- abstractmethod get_static_synaptic_data(connections: ndarray[tuple[int, ...], dtype[void]], connection_row_indices: ndarray[tuple[int, ...], dtype[integer]], n_rows: int, n_synapse_types: int, max_n_synapses: int, max_atoms_per_core: int) Tuple[List[ndarray[tuple[int, ...], dtype[uint32]]], ndarray[tuple[int, ...], dtype[integer]]][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
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:
objectA synapse dynamics object that supports signed weights.
- abstractmethod get_maximum_positive_weight(incoming_projection: Projection) float[source]¶
Get the maximum likely positive weight.
Note
This must be a value >= 0.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstractmethod get_mean_negative_weight(incoming_projection: Projection) float[source]¶
Get the mean of the negative weights.
Note
This must be a value <= 0.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstractmethod get_mean_positive_weight(incoming_projection: Projection) float[source]¶
Get the mean of the positive weights.
Note
This must be a value >= 0.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstractmethod get_minimum_negative_weight(incoming_projection: Projection) float[source]¶
Get the minimum likely negative weight.
Note
This must be a value <= 0.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstractmethod get_negative_synapse_index(incoming_projection: Projection) int[source]¶
Get the synapse type that negative weights will arrive at.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstractmethod get_positive_synapse_index(incoming_projection: Projection) int[source]¶
Get the synapse type that positive weights will arrive at.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstractmethod get_variance_negative_weight(incoming_projection: Projection) float[source]¶
Get the variance of the negative weights.
Note
This must be a value <= 0.
- Parameters:
incoming_projection (Projection) – The projection targeted
- Return type:
- abstractmethod get_variance_positive_weight(incoming_projection: Projection) float[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(delay: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None, weight: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None)¶
Bases:
objectHow do the dynamics of a synapse interact with the rest of the model.
- NUMPY_CONNECTORS_DTYPE = dtype([('source', '<u4'), ('target', '<u4'), ('weight', '<f8'), ('delay', '<f8')])¶
- property absolute_max_atoms_per_core: int¶
The absolute maximum number of atoms per core supported by this synapse dynamics object.
- Return type:
- property delay: float | str | RandomDistribution | ndarray[tuple[int, ...], dtype[float64]]¶
The delay of connections.
- Return type:
- get_connected_vertices(s_info: SynapseInformation, source_vertex: ApplicationVertex, target_vertex: ApplicationVertex) Sequence[Tuple[MachineVertex, Sequence[AbstractVertex]]][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: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the maximum delay for the synapses.
- get_delay_minimum(connector: AbstractConnector, synapse_info: SynapseInformation) float | None[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 (SynapseInformation) – synapse info
- get_delay_variance(connector: AbstractConnector, delays: Delay_Types, synapse_info: SynapseInformation) float[source]¶
Get the variance in delay for the synapses.
- Parameters:
connector (AbstractConnector)
delays (ndarray)
synapse_info (SynapseInformation)
- get_provenance_data(pre_population_label: str, post_population_label: str) List[Any][source]¶
Get the provenance data from this synapse dynamics object.
- get_synapse_id_by_target(target: str) int | None[source]¶
Get the index of the synapse type based on the name, or None if the name is not found.
- abstractmethod get_vertex_executable_suffix() str[source]¶
Get the executable suffix for a vertex for this dynamics.
- Return type:
- get_weight_maximum(connector: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the maximum weight for the synapses.
- Parameters:
connector (AbstractConnector)
synapse_info (SynapseInformation)
- get_weight_mean(connector: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the mean weight for the synapses.
- Parameters:
connector (AbstractConnector)
synapse_info (SynapseInformation)
- get_weight_variance(connector: AbstractConnector, weights: Weight_Types, synapse_info: SynapseInformation) float[source]¶
Get the variance in weight for the synapses.
- Parameters:
connector (AbstractConnector)
weights (ndarray)
synapse_info (SynapseInformation)
- abstract property is_combined_core_capable: bool¶
Whether the synapse dynamics can run on a core combined with the neuron, or if a separate core is needed.
- Return type:
- abstract property is_split_core_capable: bool¶
Whether the synapse dynamics can run on a core split from the neuron, or if only a combined core is possible.
- Return type:
- abstractmethod merge(synapse_dynamics: AbstractSynapseDynamics) AbstractSynapseDynamics[source]¶
Merge with the given synapse_dynamics and return the result, or error if merge is not possible.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics)
- Return type:
- abstract property synapses_per_second: int¶
Approximate number of synapses that can be processed per second; ideally as close to the truth as possible, but underestimate would be OK. Overestimation would potentially mean having to handle more spikes than is possible, so overruns would occur.
- validate_connection(application_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation) None[source]¶
Checks that the edge supports the connector. Returns nothing; it is assumed that an Exception will be raised if anything is wrong.
By default this checks only that the views are not used on multi-dimensional vertices.
- Parameters:
application_edge (ApplicationEdge) – The edge of the connection
synapse_info (SynapseInformation) – The synaptic information
- class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractSynapseDynamicsStructural¶
Bases:
objectBase class for synapse dynamics that structural plasticity understands.
- abstractmethod check_initial_delay(max_delay_ms: int) None[source]¶
Check that delays can be done without delay extensions.
- abstract property elimination: AbstractElimination¶
The elimination rule.
- Return type:
- abstract property formation: AbstractFormation¶
The formation rule.
- Return type:
- abstractmethod get_max_rewires_per_ts() int[source]¶
Get the max number of rewires per timestep.
- Return type:
- abstractmethod get_structural_parameters_sdram_usage_in_bytes(incoming_projections: Iterable[Projection], n_neurons: int) int[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 partner_selection: AbstractPartnerSelection¶
The partner selection rule.
- Return type:
- abstractmethod set_connections(connections: ConnectionsArray, post_vertex_slice: Slice, app_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation) None[source]¶
Set connections for structural plasticity.
- Parameters:
connections (ndarray)
post_vertex_slice (Slice)
app_edge (ProjectionApplicationEdge)
synapse_info (SynapseInformation)
- abstract property with_replacement: bool¶
Whether to allow replacement when creating synapses.
- Return type:
- abstractmethod write_structural_parameters(spec: DataSpecificationBase, region: int, weight_scales: NDArray[floating], app_vertex: PopulationVertex, vertex_slice: Slice, synaptic_matrices: SynapticMatrices) None[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: Any = None, fast: Any = None)¶
Bases:
objectThis class is deprecated.
- class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsNeuromodulation(weight: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None = 0.0, tau_c: float = 1000.0, tau_d: float = 200.0, w_min: float = 0.0, w_max: float = 1.0)¶
Bases:
AbstractPlasticSynapseDynamics,AbstractGenerateOnMachineSynapses that target a neuromodulation receptor.
- gen_matrix_params(synaptic_matrix_offset: int, delayed_matrix_offset: int, app_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation, max_row_info: MaxRowInfo, max_pre_atoms_per_core: int, max_post_atoms_per_core: int) NDArray[uint32][source]¶
Any parameters required by the matrix generator.
- Return type:
ndarray(uint32)
- property gen_matrix_params_size_in_bytes: int¶
The size of the parameters of the matrix generator in bytes.
- Return type:
- get_max_synapses(n_words: int) int[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: ndarray[tuple[int, ...], dtype[integer]]) ndarray[tuple[int, ...], dtype[integer]][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: ndarray[tuple[int, ...], dtype[integer]]) ndarray[tuple[int, ...], dtype[integer]][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: ndarray[tuple[int, ...], dtype[integer]], fp_size: ndarray[tuple[int, ...], dtype[integer]]) ndarray[tuple[int, ...], dtype[integer]][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: int) int[source]¶
Get the number of 32-bit words for n_connections in a single row.
- get_parameter_names() Iterable[str][source]¶
Get the parameter names available from the component.
- Return type:
iterable(str)
- get_parameters_sdram_usage_in_bytes(n_neurons: int, n_synapse_types: int) int[source]¶
Get the SDRAM usage of the synapse dynamics parameters in bytes.
- get_plastic_synaptic_data(connections: ConnectionsArray, connection_row_indices: NDArray[integer], n_rows: int, n_synapse_types: int, max_n_synapses: int, max_atoms_per_core: int) Tuple[NDArray[uint32], NDArray[uint32], NDArray[uint32], NDArray[uint32]][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
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 (2D), pp_data (2D), fp_size (1D), pp_size (1D))
- Return type:
- get_synapse_id_by_target(target: str) int | None[source]¶
Get the index of the synapse type based on the name, or None if the name is not found.
- get_vertex_executable_suffix() str[source]¶
Get the executable suffix for a vertex for this dynamics.
- Return type:
- property is_combined_core_capable: bool¶
Whether the synapse dynamics can run on a core combined with the neuron, or if a separate core is needed.
- Return type:
- is_neuromodulation_same_as(other: SynapseDynamicsNeuromodulation) bool[source]¶
Checks that tau c, tau d, w max and w min are all the same.
- Parameters:
other (SynapseDynamicsNeuromodulation)
- Return type:
- is_same_as(synapse_dynamics: AbstractSynapseDynamics) bool[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics)
- Return type:
- property is_split_core_capable: bool¶
Whether the synapse dynamics can run on a core split from the neuron, or if only a combined core is possible.
- Return type:
- merge(synapse_dynamics: AbstractSynapseDynamics) AbstractSynapseDynamics[source]¶
Merge with the given synapse_dynamics and return the result, or error if merge is not possible.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics)
- Return type:
- read_plastic_synaptic_data(n_synapse_types: int, pp_size: NDArray[uint32], pp_data: List[NDArray[uint32]], fp_size: NDArray[uint32], fp_data: List[NDArray[uint32]], max_atoms_per_core: int) ConnectionsArray[source]¶
Read the connections indicated in the connection indices from the data in pp_data and fp_data.
- property synapses_per_second: int¶
Approximate number of synapses that can be processed per second; ideally as close to the truth as possible, but underestimate would be OK. Overestimation would potentially mean having to handle more spikes than is possible, so overruns would occur.
- class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsSTDP(timing_dependence: AbstractTimingDependence, weight_dependence: AbstractWeightDependence, voltage_dependence: None = None, dendritic_delay_fraction: float = 1.0, weight: _In_Types = 0.0, delay: _In_Types = None, pad_to_length: int | None = None, backprop_delay: bool = True)¶
Bases:
AbstractPlasticSynapseDynamics,AbstractGenerateOnMachineThe 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
Noneto get the simulator default minimum delay.pad_to_length (int or None)
backprop_delay (bool)
- gen_matrix_params(synaptic_matrix_offset: int, delayed_matrix_offset: int, app_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation, max_row_info: MaxRowInfo, max_pre_atoms_per_core: int, max_post_atoms_per_core: int) NDArray[uint32][source]¶
Any parameters required by the matrix generator.
- Return type:
ndarray(uint32)
- property gen_matrix_params_size_in_bytes: int¶
The size of the parameters of the matrix generator in bytes.
- Return type:
- get_max_synapses(n_words: int) int[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: ndarray[tuple[int, ...], dtype[uint32]]) ndarray[tuple[int, ...], dtype[integer]][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: ndarray[tuple[int, ...], dtype[uint32]]) ndarray[tuple[int, ...], dtype[integer]][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: ndarray[tuple[int, ...], dtype[uint32]], fp_size: ndarray[tuple[int, ...], dtype[uint32]]) ndarray[tuple[int, ...], dtype[integer]][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: int) int[source]¶
Get the number of 32-bit words for n_connections in a single row.
- get_parameter_names() Iterable[str][source]¶
Get the parameter names available from the component.
- Return type:
iterable(str)
- get_plastic_synaptic_data(connections: ConnectionsArray, connection_row_indices: NDArray[integer], n_rows: int, n_synapse_types: int, max_n_synapses: int, max_atoms_per_core: int) Tuple[List[NDArray[uint32]], List[NDArray[uint32]], NDArray[uint32], NDArray[uint32]][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
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 (2D), pp_data (2D), fp_size (1D), pp_size (1D))
- Return type:
- get_weight_maximum(connector: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the maximum weight for the synapses.
- Parameters:
connector (AbstractConnector)
synapse_info (SynapseInformation)
- get_weight_mean(connector: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the mean weight for the synapses.
- Parameters:
connector (AbstractConnector)
synapse_info (SynapseInformation)
- get_weight_variance(connector: AbstractConnector, weights: Weight_Types, synapse_info: SynapseInformation) float[source]¶
Get the variance in weight for the synapses.
- Parameters:
connector (AbstractConnector)
weights (ndarray)
synapse_info (SynapseInformation)
- property is_combined_core_capable: bool¶
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: AbstractSynapseDynamics) bool[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics)
- Return type:
- property is_split_core_capable: bool¶
Whether the synapse dynamics can run on a core split from the neuron, or if only a combined core is possible.
- Return type:
- merge(synapse_dynamics: AbstractSynapseDynamics) AbstractSynapseDynamics[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: SynapseDynamicsNeuromodulation | None¶
- Return type:
- read_plastic_synaptic_data(n_synapse_types: int, pp_size: NDArray[uint32], pp_data: List[NDArray[uint32]], fp_size: NDArray[uint32], fp_data: List[NDArray[uint32]], max_atoms_per_core: int) ConnectionsArray[source]¶
Read the connections indicated in the connection indices from the data in pp_data and fp_data.
- property synapses_per_second: int¶
Approximate number of synapses that can be processed per second; ideally as close to the truth as possible, but underestimate would be OK. Overestimation would potentially mean having to handle more spikes than is possible, so overruns would occur.
- property timing_dependence: AbstractTimingDependence¶
- Return type:
- property weight_dependence: AbstractWeightDependence¶
The Weight Dependence component of the synapse dynamics.
- class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsStatic(weight: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None = 0.0, delay: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None = None, pad_to_length: int | None = None)¶
Bases:
AbstractStaticSynapseDynamics,AbstractGenerateOnMachineThe dynamics of a synapse that does not change over time.
- Parameters:
- gen_matrix_params(synaptic_matrix_offset: int, delayed_matrix_offset: int, app_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation, max_row_info: MaxRowInfo, max_pre_atoms_per_core: int, max_post_atoms_per_core: int) NDArray[uint32][source]¶
Any parameters required by the matrix generator.
- Return type:
ndarray(uint32)
- property gen_matrix_params_size_in_bytes: int¶
The size of the parameters of the matrix generator in bytes.
- Return type:
- get_max_synapses(n_words: int) int[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: ndarray[tuple[int, ...], dtype[_ScalarType_co]]) ndarray[tuple[int, ...], dtype[_ScalarType_co]][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_synapses_in_rows(ff_size: ndarray[tuple[int, ...], dtype[_ScalarType_co]]) ndarray[tuple[int, ...], dtype[_ScalarType_co]][source]¶
Get the number of synapses in the rows with sizes ff_size.
- get_n_words_for_static_connections(n_connections: int) int[source]¶
Get the number of 32-bit words for n_connections in a single row.
- get_parameter_names() Iterable[str][source]¶
Get the parameter names available from the component.
- Return type:
iterable(str)
- get_parameters_sdram_usage_in_bytes(n_neurons: int, n_synapse_types: int) int[source]¶
Get the SDRAM usage of the synapse dynamics parameters in bytes.
- get_static_synaptic_data(connections: ConnectionsArray, connection_row_indices: NDArray[integer], n_rows: int, n_synapse_types: int, max_n_synapses: int, max_atoms_per_core: int) Tuple[List[NDArray], NDArray][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
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() str[source]¶
Get the executable suffix for a vertex for this dynamics.
- Return type:
- property is_combined_core_capable: bool¶
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: AbstractSynapseDynamics) bool[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics)
- Return type:
- property is_split_core_capable: bool¶
Whether the synapse dynamics can run on a core split from the neuron, or if only a combined core is possible.
- Return type:
- merge(synapse_dynamics: AbstractSynapseDynamics) AbstractSynapseDynamics[source]¶
Merge with the given synapse_dynamics and return the result, or error if merge is not possible.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics)
- Return type:
- read_static_synaptic_data(n_synapse_types: int, ff_size: NDArray[integer], ff_data: List[NDArray[uint32]], max_atoms_per_core: int) ConnectionsArray[source]¶
Read the connections from the words of data in ff_data.
- property synapses_per_second: int¶
Approximate number of synapses that can be processed per second; ideally as close to the truth as possible, but underestimate would be OK. Overestimation would potentially mean having to handle more spikes than is possible, so overruns would occur.
- class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsStructuralCommon¶
Bases:
AbstractSynapseDynamicsStructuralCommon code for structural synapse dynamics.
- PAIR_ERROR = 'Only one Projection between each pair of Populations can use structural plasticity'¶
- check_initial_delay(max_delay_ms: float) None[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
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 property connections: ConnectionsInfo¶
Initial connectivity as defined via connector.
- Return type:
- get_structural_parameters_sdram_usage_in_bytes(incoming_projections: Iterable[Projection], n_neurons: int) int[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: AbstractSynapseDynamicsStructural) bool[source]¶
- Parameters:
synapse_dynamics (SynapseDynamicsStructuralCommon)
- Return type:
- property reduction_synapses_per_second: int¶
Approximate fewer number of synapses that can be processed per second as a result of rewiring cycles used.
- write_structural_parameters(spec: DataSpecificationBase, region: int, weight_scales: NDArray[numpy.floating], app_vertex: PopulationVertex, vertex_slice: Slice, synaptic_matrices: SynapticMatrices) None[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: AbstractPartnerSelection, formation: AbstractFormation, elimination: AbstractElimination, timing_dependence: AbstractTimingDependence, weight_dependence: AbstractWeightDependence, voltage_dependence: None = None, dendritic_delay_fraction: float = 1.0, f_rew: float = 10000.0, initial_weight: float = 0.0, initial_delay: InitialDelay = 1.0, s_max: int = 32, with_replacement: bool = True, seed: int | None = None, weight: _In_Types = 0.0, delay: _In_Types = None, backprop_delay: bool = True)¶
Bases:
SynapseDynamicsSTDP,SynapseDynamicsStructuralCommonClass 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
Noneto get the simulator default minimum delay.backprop_delay (bool) – Whether back-propagated delays are used
- property connections: ConnectionsInfo¶
Initial connectivity as defined via connector.
- Return type:
- property elimination: AbstractElimination¶
The elimination rule.
- Return type:
- property formation: AbstractFormation¶
The formation rule.
- Return type:
- generate_on_machine() bool[source]¶
Determines if this instance should be generated on the machine.
Default implementation returns True
- Return type:
- get_connected_vertices(s_info: SynapseInformation, source_vertex: ApplicationVertex, target_vertex: ApplicationVertex) Sequence[Tuple[MachineVertex, Sequence[AbstractVertex]]][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: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the maximum delay for the synapses.
- get_delay_minimum(connector: AbstractConnector, synapse_info: SynapseInformation) float | None[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 (SynapseInformation) – synapse info
- get_delay_variance(connector: AbstractConnector, delays: Delay_Types, synapse_info: SynapseInformation) float[source]¶
Get the variance in delay for the synapses.
- Parameters:
connector (AbstractConnector)
delays (ndarray)
synapse_info (SynapseInformation)
- get_parameter_names() Iterable[str][source]¶
Get the parameter names available from the component.
- Return type:
iterable(str)
- get_weight_maximum(connector: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the maximum weight for the synapses.
- Parameters:
connector (AbstractConnector)
synapse_info (SynapseInformation)
- get_weight_mean(connector: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the mean weight for the synapses.
- Parameters:
connector (AbstractConnector)
synapse_info (SynapseInformation)
- property is_combined_core_capable: bool¶
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: AbstractSynapseDynamics | AbstractSynapseDynamicsStructural) bool[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (SynapseDynamicsStructuralCommon)
synapse_dynamics
- Return type:
- Return type:
- property is_split_core_capable: bool¶
Whether the synapse dynamics can run on a core split from the neuron, or if only a combined core is possible.
- Return type:
- merge(synapse_dynamics: AbstractSynapseDynamics) SynapseDynamicsStructuralSTDP[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: AbstractPartnerSelection¶
The partner selection rule.
- Return type:
- set_connections(connections: ConnectionsArray, post_vertex_slice: Slice, app_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation) None[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: AbstractPartnerSelection, formation: AbstractFormation, elimination: AbstractElimination, f_rew: float = 10000.0, initial_weight: float = 0.0, initial_delay: InitialDelay = 1.0, s_max: int = 32, with_replacement: bool = True, seed: int | None = None, weight: float = 0.0, delay: float | None = None)¶
Bases:
SynapseDynamicsStatic,SynapseDynamicsStructuralCommonClass 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
Noneto get the simulator default minimum delay.
- property connections: ConnectionsInfo¶
Initial connectivity as defined via connector.
- Return type:
- property elimination: AbstractElimination¶
The elimination rule.
- Return type:
- property formation: AbstractFormation¶
The formation rule.
- Return type:
- generate_on_machine() bool[source]¶
Determines if this instance should be generated on the machine.
Default implementation returns True
- Return type:
- get_connected_vertices(s_info: SynapseInformation, source_vertex: ApplicationVertex, target_vertex: ApplicationVertex) Sequence[Tuple[MachineVertex, Sequence[AbstractVertex]]][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: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the maximum delay for the synapses.
- get_delay_minimum(connector: AbstractConnector, synapse_info: SynapseInformation) float | None[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 (SynapseInformation) – synapse info
- get_delay_variance(connector: AbstractConnector, delays: Delay_Types, synapse_info: SynapseInformation) float[source]¶
Get the variance in delay for the synapses.
- Parameters:
connector (AbstractConnector)
delays (ndarray)
synapse_info (SynapseInformation)
- get_parameter_names() Iterable[str][source]¶
Get the parameter names available from the component.
- Return type:
iterable(str)
- get_vertex_executable_suffix() str[source]¶
Get the executable suffix for a vertex for this dynamics.
- Return type:
- get_weight_maximum(connector: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the maximum weight for the synapses.
- Parameters:
connector (AbstractConnector)
synapse_info (SynapseInformation)
- get_weight_mean(connector: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the mean weight for the synapses.
- Parameters:
connector (AbstractConnector)
synapse_info (SynapseInformation)
- get_weight_variance(connector: AbstractConnector, weights: Weight_Types, synapse_info: SynapseInformation) float[source]¶
Get the variance in weight for the synapses.
- Parameters:
connector (AbstractConnector)
weights (ndarray)
synapse_info (SynapseInformation)
- property initial_delay: InitialDelay¶
The delay of a formed connection.
- property is_combined_core_capable: bool¶
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: AbstractSynapseDynamics | AbstractSynapseDynamicsStructural) bool[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (SynapseDynamicsStructuralCommon)
synapse_dynamics
- Return type:
- Return type:
- property is_split_core_capable: bool¶
Whether the synapse dynamics can run on a core split from the neuron, or if only a combined core is possible.
- Return type:
- merge(synapse_dynamics: AbstractSynapseDynamics) AbstractSynapseDynamics[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: AbstractPartnerSelection¶
The partner selection rule.
- Return type:
- set_connections(connections: ConnectionsArray, post_vertex_slice: Slice, app_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation) None[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.SynapseDynamicsWeightChangable(weight_min: float, weight_max: float, weight: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None = 0.0, delay: float | str | RandomDistribution | Iterable[float] | ndarray[tuple[int, ...], dtype[float64]] | None = None)¶
Bases:
AbstractPlasticSynapseDynamics,AbstractGenerateOnMachineThe dynamics of a synapse that can be changed simply by the sending of an external signal.
- Parameters:
- gen_matrix_params(synaptic_matrix_offset: int, delayed_matrix_offset: int, app_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation, max_row_info: MaxRowInfo, max_pre_atoms_per_core: int, max_post_atoms_per_core: int) NDArray[uint32][source]¶
Any parameters required by the matrix generator.
- Return type:
ndarray(uint32)
- property gen_matrix_params_size_in_bytes: int¶
The size of the parameters of the matrix generator in bytes.
- Return type:
- get_max_synapses(n_words: int) int[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: ndarray[tuple[int, ...], dtype[uint32]]) ndarray[tuple[int, ...], dtype[integer]][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: ndarray[tuple[int, ...], dtype[uint32]]) ndarray[tuple[int, ...], dtype[integer]][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: ndarray[tuple[int, ...], dtype[uint32]], fp_size: ndarray[tuple[int, ...], dtype[uint32]]) ndarray[tuple[int, ...], dtype[integer]][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: int) int[source]¶
Get the number of 32-bit words for n_connections in a single row.
- get_parameter_names() Iterable[str][source]¶
Get the parameter names available from the component.
- Return type:
iterable(str)
- get_parameters_sdram_usage_in_bytes(n_neurons: int, n_synapse_types: int) int[source]¶
Get the SDRAM usage of the synapse dynamics parameters in bytes.
- get_plastic_synaptic_data(connections: ConnectionsArray, connection_row_indices: NDArray[integer], n_rows: int, n_synapse_types: int, max_n_synapses: int, max_atoms_per_core: int) Tuple[List[NDArray[uint32]], List[NDArray[uint32]], NDArray[uint32], NDArray[uint32]][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
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 (2D), pp_data (2D), fp_size (1D), pp_size (1D))
- Return type:
- get_synapse_info_index(synapse_info: SynapseInformation) int[source]¶
Get the row offset for the given synapse information. Each synapse information has a unique row offset which then allows for multiple connections to be identified and kept separate.
- get_vertex_executable_suffix() str[source]¶
Get the executable suffix for a vertex for this dynamics.
- get_weight_maximum(connector: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the maximum weight for the synapses.
- Parameters:
connector (AbstractConnector)
synapse_info (SynapseInformation)
- get_weight_mean(connector: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the mean weight for the synapses.
- Parameters:
connector (AbstractConnector)
synapse_info (SynapseInformation)
- get_weight_variance(connector: AbstractConnector, weights: Weight_Types, synapse_info: SynapseInformation) float[source]¶
Get the variance in weight for the synapses.
- Parameters:
connector (AbstractConnector)
weights (ndarray)
synapse_info (SynapseInformation)
- property is_combined_core_capable: bool¶
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: AbstractSynapseDynamics) bool[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics)
- Return type:
- property is_split_core_capable: bool¶
Whether the synapse dynamics can run on a core split from the neuron, or if only a combined core is possible.
- Return type:
- merge(synapse_dynamics: AbstractSynapseDynamics) AbstractSynapseDynamics[source]¶
Merge with the given synapse_dynamics and return the result, or error if merge is not possible.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics)
- Return type:
- read_plastic_synaptic_data(n_synapse_types: int, pp_size: NDArray[uint32], pp_data: List[NDArray[uint32]], fp_size: NDArray[uint32], fp_data: List[NDArray[uint32]], max_atoms_per_core: int) ConnectionsArray[source]¶
Read the connections indicated in the connection indices from the data in pp_data and fp_data.
- property synapses_per_second: int¶
Approximate number of synapses that can be processed per second; ideally as close to the truth as possible, but underestimate would be OK. Overestimation would potentially mean having to handle more spikes than is possible, so overruns would occur.
- validate_connection(application_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation) None[source]¶
Checks that the edge supports the connector. Returns nothing; it is assumed that an Exception will be raised if anything is wrong.
By default this checks only that the views are not used on multi-dimensional vertices.
- Parameters:
application_edge (ApplicationEdge) – The edge of the connection
synapse_info (SynapseInformation) – The synaptic information
- class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsWeightChanger(weight_change: float, projection: Projection)¶
Bases:
AbstractPlasticSynapseDynamics,AbstractGenerateOnMachineSynapses that target a weight change
- Parameters:
weight_change (float) – The positive or negative change in weight to apply on each spike
projection (Projection) – The projection that this synapse dynamics is being added to
- gen_matrix_params(synaptic_matrix_offset: int, delayed_matrix_offset: int, app_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation, max_row_info: MaxRowInfo, max_pre_atoms_per_core: int, max_post_atoms_per_core: int) NDArray[uint32][source]¶
Any parameters required by the matrix generator.
- Return type:
ndarray(uint32)
- property gen_matrix_params_size_in_bytes: int¶
The size of the parameters of the matrix generator in bytes.
- Return type:
- get_max_synapses(n_words: int) int[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: ndarray[tuple[int, ...], dtype[integer]]) ndarray[tuple[int, ...], dtype[integer]][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: ndarray[tuple[int, ...], dtype[integer]]) ndarray[tuple[int, ...], dtype[integer]][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: ndarray[tuple[int, ...], dtype[integer]], fp_size: ndarray[tuple[int, ...], dtype[integer]]) ndarray[tuple[int, ...], dtype[integer]][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: int) int[source]¶
Get the number of 32-bit words for n_connections in a single row.
- get_parameter_names() Iterable[str][source]¶
Get the parameter names available from the component.
- Return type:
iterable(str)
- get_parameters_sdram_usage_in_bytes(n_neurons: int, n_synapse_types: int) int[source]¶
Get the SDRAM usage of the synapse dynamics parameters in bytes.
- get_plastic_synaptic_data(connections: ConnectionsArray, connection_row_indices: NDArray[integer], n_rows: int, n_synapse_types: int, max_n_synapses: int, max_atoms_per_core: int) Tuple[NDArray[uint32], NDArray[uint32], NDArray[uint32], NDArray[uint32]][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
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 (2D), pp_data (2D), fp_size (1D), pp_size (1D))
- Return type:
- get_synapse_id_by_target(target: str) int | None[source]¶
Get the index of the synapse type based on the name, or None if the name is not found.
- get_vertex_executable_suffix() str[source]¶
Get the executable suffix for a vertex for this dynamics.
- Return type:
- get_weight_maximum(connector: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the maximum weight for the synapses.
- Parameters:
connector (AbstractConnector)
synapse_info (SynapseInformation)
- get_weight_mean(connector: AbstractConnector, synapse_info: SynapseInformation) float[source]¶
Get the mean weight for the synapses.
- Parameters:
connector (AbstractConnector)
synapse_info (SynapseInformation)
- get_weight_variance(connector: AbstractConnector, weights: Weight_Types, synapse_info: SynapseInformation) float[source]¶
Get the variance in weight for the synapses.
- Parameters:
connector (AbstractConnector)
weights (ndarray)
synapse_info (SynapseInformation)
- property is_combined_core_capable: bool¶
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: AbstractSynapseDynamics) bool[source]¶
Determines if this synapse dynamics is the same as another.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics)
- Return type:
- property is_split_core_capable: bool¶
Whether the synapse dynamics can run on a core split from the neuron, or if only a combined core is possible.
- Return type:
- merge(synapse_dynamics: AbstractSynapseDynamics) AbstractSynapseDynamics[source]¶
Merge with the given synapse_dynamics and return the result, or error if merge is not possible.
- Parameters:
synapse_dynamics (AbstractSynapseDynamics)
- Return type:
- read_plastic_synaptic_data(n_synapse_types: int, pp_size: NDArray[uint32], pp_data: List[NDArray[uint32]], fp_size: NDArray[uint32], fp_data: List[NDArray[uint32]], max_atoms_per_core: int) ConnectionsArray[source]¶
Read the connections indicated in the connection indices from the data in pp_data and fp_data.
- property synapses_per_second: int¶
Approximate number of synapses that can be processed per second; ideally as close to the truth as possible, but underestimate would be OK. Overestimation would potentially mean having to handle more spikes than is possible, so overruns would occur.
- validate_connection(application_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation) None[source]¶
Checks that the edge supports the connector. Returns nothing; it is assumed that an Exception will be raised if anything is wrong.
By default this checks only that the views are not used on multi-dimensional vertices.
- Parameters:
application_edge (ApplicationEdge) – The edge of the connection
synapse_info (SynapseInformation) – The synaptic information
- spynnaker.pyNN.models.neuron.synapse_dynamics.calculate_spike_pair_additive_stdp_weight(pre_spikes: ndarray[tuple[int, ...], dtype[integer]], post_spikes: ndarray[tuple[int, ...], dtype[integer]], initial_weight: float, plastic_delay: int, a_plus: float, a_minus: float, tau_plus: float, tau_minus: float) float¶
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: ndarray[tuple[int, ...], dtype[integer]], post_spikes: ndarray[tuple[int, ...], dtype[integer]], initial_weight: float, plastic_delay: int, min_weight: float, max_weight: float, a_plus: float, a_minus: float, tau_plus: float, tau_minus: float) float¶
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: