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.

gen_matrix_id

The ID of the on-machine matrix generator.

Return type:int
gen_matrix_params

Any parameters required by the matrix generator.

Return type:ndarray(uint32)
gen_matrix_params_size_in_bytes

The size of the parameters of the matrix generator in bytes.

Return type:int
generate_on_machine()[source]

Determines if this instance should be generated on the machine.

Default implementation returns True

Return type:bool
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:

tuple(ndarray, ndarray, ndarray, ndarray)

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:

ndarray

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:

tuple(list(ndarray), ndarray)

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:
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

are_weights_signed()[source]

Determines if the weights are signed values

Return type:bool
changes_during_run

Determine if the synapses change during a run

Return type:bool
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:
  • connection_row_indices (ndarray) – The index of the row that each item should go into
  • n_rows (int) – The number of rows
  • data (ndarray) – The non-row-based data
  • max_n_synapses (int) – The maximum number of synapses to generate in each row
Return type:

list(ndarray)

delay

The delay of connections

get_delay_maximum(connector, synapse_info)[source]

Get the maximum delay for the synapses

Parameters:
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:
get_delay_variance(connector, delays, synapse_info)[source]

Get the variance in delay for the synapses

Parameters:
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:

ndarray

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:
  • n_neurons (int) –
  • n_synapse_types (int) –
Return type:

int

get_provenance_data(pre_population_label, post_population_label)[source]

Get the provenance data from this synapse dynamics object

Parameters:
  • pre_population_label (str) –
  • post_population_label (str) –
Return type:

iterable(ProvenanceDataItem)

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:
get_weight_mean(connector, synapse_info)[source]

Get the mean weight for the synapses

Parameters:
get_weight_variance(connector, weights, synapse_info)[source]

Get the variance in weight for the synapses

Parameters:
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

set_delay(delay)[source]

Set the delay

weight

The weight of connections

write_parameters(spec, region, weight_scales)[source]

Write the synapse parameters to the spec

Parameters:
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
f_rew

The frequency of rewiring

Return type:float
formation

The formation rule

Return type:AbstractFormation
get_max_rewires_per_ts()[source]

Get the max number of rewires per timestep

Return type:int
get_structural_parameters_sdram_usage_in_bytes(graph, vertex, 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:

int

Raises:

PacmanInvalidParameterException

initial_delay

The delay of a formed connection

Return type:float or (float, float)
initial_weight

The weight of a formed connection

Return type:float
partner_selection

The partner selection rule

Return type:AbstractPartnerSelection
s_max

The maximum number of synapses

Return type:int
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:
with_replacement

Whether to allow replacement when creating synapses

Return type:bool
write_structural_parameters(spec, region, weight_scales, machine_graph, machine_vertex, routing_info, synaptic_matrices)[source]

Write structural plasticity parameters

Parameters:
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:
  • weight (float) –
  • delay (float or None) – Use None to get the simulator default minimum delay.
  • pad_to_length (int) –
are_weights_signed()[source]

Determines if the weights are signed values

Return type:bool
changes_during_run

Determine if the synapses change during a run

Return type:bool
delay

The delay of connections

gen_matrix_id

The ID of the on-machine matrix generator.

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_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:
  • n_neurons (int) –
  • n_synapse_types (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:

tuple(list(ndarray), ndarray)

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!

set_delay(delay)[source]

Set the delay

set_value(key, value)[source]

Set a property

Parameters:
  • key (str) – the name of the parameter to change
  • value (Any or float or int or list(float) or list(int)) – the new value of the parameter to assign
weight

The weight of connections

write_parameters(spec, region, weight_scales)[source]

Write the synapse parameters to the spec

Parameters:
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:
are_weights_signed()[source]
Return type:bool
backprop_delay

Settable.

Return type:bool
changes_during_run

Determine if the synapses change during a run

Return type:bool
delay

The delay of connections

dendritic_delay_fraction

Settable.

Return type:float
gen_matrix_id

The ID of the on-machine matrix generator.

Return type:int
gen_matrix_params

Any parameters required by the matrix generator.

Return type:ndarray(uint32)
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_parameters_sdram_usage_in_bytes(n_neurons, n_synapse_types)[source]
Parameters:
  • n_neurons (int) –
  • n_synapse_types (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:

tuple(ndarray, ndarray, ndarray, ndarray)

get_provenance_data(pre_population_label, post_population_label)[source]

Get the provenance data from this synapse dynamics object

Parameters:
  • pre_population_label (str) –
  • post_population_label (str) –
Return type:

iterable(ProvenanceDataItem)

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]
Return type:str
get_weight_maximum(connector, synapse_info)[source]

Get the maximum weight for the synapses

Parameters:
get_weight_mean(connector, synapse_info)[source]

Get the mean weight for the synapses

Parameters:
get_weight_variance(connector, weights, synapse_info)[source]

Get the variance in weight for the synapses

Parameters:
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_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:

ndarray

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!

set_delay(delay)[source]

Set the delay

set_value(key, value)[source]

Set a property

Parameters:
  • key (str) – the name of the parameter to change
  • value (Any or float or int or list(float) or list(int)) – the new value of the parameter to assign
timing_dependence
Return type:AbstractTimingDependence
weight

The weight of connections

weight_dependence
Return type:AbstractTimingDependence
write_parameters(spec, region, weight_scales)[source]
Parameters:
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
connections

initial connectivity as defined via connector

Return type:dict
get_max_rewires_per_ts()[source]

Get the max number of rewires per timestep

Return type:int
get_parameter_names()[source]
Return type:list(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_structural_parameters_sdram_usage_in_bytes(graph, vertex, 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:

int

Raises:

PacmanInvalidParameterException

get_vertex_executable_suffix()[source]
Return type:str
is_same_as(synapse_dynamics)[source]
Parameters:synapse_dynamics (SynapseDynamicsStructuralCommon) –
Return type:bool
p_rew

The period of rewiring.

Returns:The period of rewiring
Return type:float
write_structural_parameters(spec, region, weight_scales, machine_graph, machine_vertex, routing_info, synaptic_matrices)[source]

Write structural plasticity parameters

Parameters:
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.
changes_during_run

Determine if the synapses change during a run

Return type:bool
connections

initial connectivity as defined via connector

Return type:dict
elimination

The elimination rule

Return type:AbstractElimination
f_rew

The frequency of rewiring

Return type:float
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_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:
get_weight_mean(connector, synapse_info)[source]

Get the mean weight for the synapses

Parameters:
get_weight_variance(connector, weights, synapse_info)[source]

Get the variance in weight for the synapses

Parameters:
initial_delay

The delay of a formed connection

Return type:float or (float, float)
initial_weight

The weight of a formed connection

Return type:float
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
s_max

The maximum number of synapses

Return type:int
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:
set_projection_parameter(param, value)[source]
Parameters:
  • param (str) –
  • value
with_replacement

Whether to allow replacement when creating synapses

Return type:bool
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.
connections

initial connectivity as defined via connector

Return type:dict
elimination

The elimination rule

Return type:AbstractElimination
f_rew

The frequency of rewiring

Return type:float
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_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_vertex_executable_suffix()[source]
Return type:str
get_weight_maximum(connector, synapse_info)[source]

Get the maximum weight for the synapses

Parameters:
get_weight_mean(connector, synapse_info)[source]

Get the mean weight for the synapses

Parameters:
initial_delay

The delay of a formed connection

Return type:float or (float, float)
initial_weight

The weight of a formed connection

Return type:float
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
s_max

The maximum number of synapses

Return type:int
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:
set_projection_parameter(param, value)[source]
Parameters:
  • param (str) –
  • value
with_replacement

Whether to allow replacement when creating synapses

Return type:bool