spynnaker.pyNN.models.neuron.synapse_dynamics package

Submodules

spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_generate_on_machine module

class spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_generate_on_machine.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:numpy array of 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.abstract_generate_on_machine.MatrixGeneratorID[source]

Bases: enum.Enum

An enumeration.

STATIC_MATRIX = 0
STDP_MATRIX = 1

spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_plastic_synapse_dynamics module

class spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_plastic_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

get_n_plastic_plastic_words_per_row(pp_size)[source]

Get the number of plastic plastic words to be read from each row

get_n_synapses_in_rows(pp_size, fp_size)[source]

Get the number of synapses in each of the rows with plastic sizes pp_size and fp_size

get_n_words_for_plastic_connections(n_connections)[source]

Get the number of 32-bit words for n_connections in a single row

get_plastic_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types)[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.

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

spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_static_synapse_dynamics module

class spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_static_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

get_n_synapses_in_rows(ff_size)[source]

Get the number of synapses in the rows with sizes ff_size

get_n_words_for_static_connections(n_connections)[source]

Get the number of 32-bit words for n_connections in a single row

get_static_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types)[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.

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

spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_synapse_dynamics module

class spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_synapse_dynamics.AbstractSynapseDynamics[source]

Bases: object

NUMPY_CONNECTORS_DTYPE = [('source', 'uint32'), ('target', 'uint32'), ('weight', 'float64'), ('delay', 'float64')]
are_weights_signed()[source]

Determines if the weights are signed values

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)[source]

Converts per-connection data generated from connections into row-based data to be returned from get_synaptic_data

delay

The delay of connections

get_delay_maximum(connector, synapse_info)[source]

Get the maximum delay for the synapses

get_delay_variance(connector, delays)[source]

Get the variance in delay for the synapses

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

get_parameter_names()[source]

Get the parameter names available from the synapse dynamics components

Return type:iterable(str)
get_parameters_sdram_usage_in_bytes(n_neurons, n_synapse_types)[source]

Get the SDRAM usage of the synapse dynamics parameters in bytes

get_provenance_data(pre_population_label, post_population_label)[source]

Get the provenance data from this synapse dynamics object

get_vertex_executable_suffix()[source]

Get the executable suffix for a vertex for this dynamics

get_weight_maximum(connector, synapse_info)[source]

Get the maximum weight for the synapses

get_weight_mean(connector, synapse_info)[source]

Get the mean weight for the synapses

get_weight_variance(connector, weights)[source]

Get the variance in weight for the synapses

get_words(rows)[source]

Convert the row data to words

is_same_as(synapse_dynamics)[source]

Determines if this synapse dynamics is the same as another

merge(synapse_dynamics)[source]

Merge with the given synapse_dynamics and return the result, or error if merge is not possible

set_delay(delay)[source]

Set the delay

weight

The weight of connections

write_parameters(spec, region, machine_time_step, weight_scales)[source]

Write the synapse parameters to the spec

spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_synapse_dynamics_structural module

class spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_synapse_dynamics_structural.AbstractSynapseDynamicsStructural[source]

Bases: object

elimination

The elimination rule

f_rew

The frequency of rewiring

formation

The formation rule

get_structural_parameters_sdram_usage_in_bytes(application_graph, app_vertex, n_neurons, n_synapse_types)[source]

Get the size of the structural parameters

initial_delay

The delay of a formed connection

initial_weight

The weight of a formed connection

partner_selection

The partner selection rule

s_max

The maximum number of synapses

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

write_structural_parameters(spec, region, machine_time_step, weight_scales, application_graph, app_vertex, post_slice, graph_mapper, routing_info, synapse_indices)[source]

Write structural plasticity parameters

spynnaker.pyNN.models.neuron.synapse_dynamics.pynn_synapse_dynamics module

class spynnaker.pyNN.models.neuron.synapse_dynamics.pynn_synapse_dynamics.PyNNSynapseDynamics(slow=None, fast=None)[source]

Bases: object

slow

spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_static module

class spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_static.SynapseDynamicsStatic(weight=0.0, delay=1.0, 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

are_weights_signed()[source]

Determines if the weights are signed values

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

get_n_synapses_in_rows(ff_size)[source]

Get the number of synapses in the rows with sizes ff_size

get_n_words_for_static_connections(n_connections)[source]

Get the number of 32-bit words for n_connections in a single row

get_parameter_names()[source]

Get the parameter names available from the synapse dynamics components

Return type:iterable(str)
get_parameters_sdram_usage_in_bytes(n_neurons, n_synapse_types)[source]

Get the SDRAM usage of the synapse dynamics parameters in bytes

get_static_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types)[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.

get_value(key)[source]

Get a property Get a property

get_vertex_executable_suffix()[source]

Get the executable suffix for a vertex for this dynamics

is_same_as(synapse_dynamics)[source]

Determines if this synapse dynamics is the same as another

mark_no_changes()[source]

Marks the point after which changes are reported, so that new changes can be detected before the next check. 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

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

requires_mapping

True if changes that have been made require that mapping be performed. By default this returns False but can be overridden to indicate changes that require mapping.

Return type:bool 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 – the name of the parameter to change
  • value – the new value of the parameter to assign Set a property
  • key – the name of the parameter to change
  • value – the new value of the parameter to assign
weight

The weight of connections

write_parameters(spec, region, machine_time_step, weight_scales)[source]

Write the synapse parameters to the spec

spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_stdp module

class spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_stdp.SynapseDynamicsSTDP(timing_dependence=None, weight_dependence=None, voltage_dependence=None, dendritic_delay_fraction=1.0, weight=0.0, delay=1.0, 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

are_weights_signed()[source]

Determines if the weights are signed values

backprop_delay
changes_during_run

Determine if the synapses change during a run

Return type:bool
delay

The delay of connections

dendritic_delay_fraction
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:numpy array of 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 – 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

get_n_plastic_plastic_words_per_row(pp_size)[source]

Get the number of plastic plastic words to be read from each row

get_n_synapses_in_rows(pp_size, fp_size)[source]

Get the number of synapses in each of the rows with plastic sizes pp_size and fp_size

get_n_words_for_plastic_connections(n_connections)[source]

Get the number of 32-bit words for n_connections in a single row

get_parameter_names()[source]

Get the parameter names available from the synapse dynamics components

Return type:iterable(str)
get_parameters_sdram_usage_in_bytes(n_neurons, n_synapse_types)[source]

Get the SDRAM usage of the synapse dynamics parameters in bytes

get_plastic_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types)[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.

get_provenance_data(pre_population_label, post_population_label)[source]

Get the provenance data from this synapse dynamics object

get_value(key)[source]

Get a property Get a property

get_vertex_executable_suffix()[source]

Get the executable suffix for a vertex for this dynamics

get_weight_maximum(connector, synapse_info)[source]

Get the maximum weight for the synapses

get_weight_mean(connector, synapse_info)[source]

Get the mean weight for the synapses

get_weight_variance(connector, weights)[source]

Get the variance in weight for the synapses

is_same_as(synapse_dynamics)[source]

Determines if this synapse dynamics is the same as another

mark_no_changes()[source]

Marks the point after which changes are reported, so that new changes can be detected before the next check. 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

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

requires_mapping

True if changes that have been made require that mapping be performed. By default this returns False but can be overridden to indicate changes that require mapping.

Return type:bool 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 – the name of the parameter to change
  • value – the new value of the parameter to assign Set a property
  • key – the name of the parameter to change
  • value – the new value of the parameter to assign
timing_dependence
weight

The weight of connections

weight_dependence
write_parameters(spec, region, machine_time_step, weight_scales)[source]

Write the synapse parameters to the spec

spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_structural_common module

class spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_structural_common.SynapseDynamicsStructuralCommon(partner_selection, formation, elimination, f_rew, initial_weight, initial_delay, s_max, seed)[source]

Bases: object

Utility class that holds properties of synaptic rewiring both in the presence and absence of STDP.

Written by Petrut Bogdan.

Parameters:
  • partner_selection – The partner selection rule
  • formation – The formation rule
  • elimination – The elimination rule
  • f_rew (int) – How many rewiring attempts will be done per second.
  • initial_weight (float) – Initial weight assigned to a newly formed connection
  • initial_delay (int or (int, int)) – Delay assigned to a newly formed connection
  • s_max (int) – Maximum fan-in per target layer neuron
  • seed (int) – seed the random number generators
DEFAULT_F_REW = 10000
DEFAULT_INITIAL_DELAY = 1
DEFAULT_INITIAL_WEIGHT = 0
DEFAULT_S_MAX = 32
KEY_ATOM_INFO_SIZE = 20
POST_TO_PRE_ENTRY_SIZE = 4
PRE_POP_INFO_BASE_SIZE = 20
REWIRING_DATA_SIZE = 64
actual_sdram_usage

Actual SDRAM usage (based on what is written to spec).

Returns:actual SDRAM usage
Return type:int
elimination
f_rew
formation
get_parameter_names()[source]
get_parameters_sdram_usage_in_bytes(application_graph, app_vertex, n_neurons)[source]

Get SDRAM usage

Returns:SDRAM usage
Return type:int
get_vertex_executable_suffix()[source]
initial_delay
initial_weight
is_same_as(synapse_dynamics)[source]
n_words_for_plastic_connections(value)[source]

Set size of plastic connections in words

n_words_for_static_connections(value)[source]

Set size of static connections in words

p_rew

The period of rewiring.

Returns:The period of rewiring
Return type:int
partner_selection
s_max
seed
set_projection_parameter(param, value)[source]
synaptic_data_update(connections, post_vertex_slice, app_edge, synapse_info, machine_edge)[source]

Set synaptic data

write_parameters(spec, region, machine_time_step, weight_scales, application_graph, app_vertex, post_slice, graph_mapper, routing_info, synapse_indices)[source]

Write the synapse parameters to the spec.

spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_structural_static module

class spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_structural_static.SynapseDynamicsStructuralStatic(partner_selection, formation, elimination, f_rew=10000, initial_weight=0, initial_delay=1, s_max=32, seed=None, weight=0.0, delay=1.0)[source]

Bases: spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_static.SynapseDynamicsStatic, spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_synapse_dynamics_structural.AbstractSynapseDynamicsStructural

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 – The partner selection rule
  • formation – The formation rule
  • elimination – The elimination rule
  • f_rew (int) – 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
  • seed (int) – seed the random number generators
  • weight – The weight of connections formed by the connector
  • delay – The delay of connections formed by the connector
changes_during_run

Determine if the synapses change during a run

Return type:bool
elimination

The elimination rule

f_rew

The frequency of rewiring

formation

The formation rule

get_n_words_for_static_connections(n_connections)[source]

Get the number of 32-bit words for n_connections in a single row

get_parameter_names()[source]

Get the parameter names available from the synapse dynamics components

Return type:iterable(str)
get_structural_parameters_sdram_usage_in_bytes(application_graph, app_vertex, n_neurons, n_synapse_types)[source]

Get the size of the structural parameters

get_vertex_executable_suffix()[source]

Get the executable suffix for a vertex for this dynamics

get_weight_maximum(connector, synapse_info)[source]

Get the maximum weight for the synapses

get_weight_mean(connector, synapse_info)[source]

Get the mean weight for the synapses

get_weight_variance(connector, weights)[source]

Get the variance in weight for the synapses

initial_delay

The delay of a formed connection

initial_weight

The weight of a formed connection

is_same_as(synapse_dynamics)[source]

Determines if this synapse dynamics is the same as another

merge(synapse_dynamics)[source]

Merge with the given synapse_dynamics and return the result, or error if merge is not possible

partner_selection

The partner selection rule

s_max

The maximum number of synapses

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

set_projection_parameter(param, value)[source]
write_structural_parameters(spec, region, machine_time_step, weight_scales, application_graph, app_vertex, post_slice, graph_mapper, routing_info, synapse_indices)[source]

Write structural plasticity parameters

spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_structural_stdp module

class spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_structural_stdp.SynapseDynamicsStructuralSTDP(partner_selection, formation, elimination, timing_dependence=None, weight_dependence=None, voltage_dependence=None, dendritic_delay_fraction=1.0, f_rew=10000, initial_weight=0, initial_delay=1, s_max=32, seed=None, weight=0.0, delay=1.0, backprop_delay=True)[source]

Bases: spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_stdp.SynapseDynamicsSTDP, spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_synapse_dynamics_structural.AbstractSynapseDynamicsStructural

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 – The partner selection rule
  • formation – The formation rule
  • elimination – The elimination rule
  • timing_dependence – The STDP timing dependence
  • weight_dependence – The STDP weight dependence
  • voltage_dependence – The STDP voltage dependence
  • dendritic_delay_fraction – The STDP dendritic delay fraction
  • f_rew (int) – 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
  • seed (int) – seed the random number generators
  • weight – The weight of connections formed by the connector
  • delay – The delay of connections formed by the connector
elimination

The elimination rule

f_rew

The frequency of rewiring

formation

The formation rule

get_n_words_for_plastic_connections(n_connections)[source]

Get the number of 32-bit words for n_connections in a single row

get_parameter_names()[source]

Get the parameter names available from the synapse dynamics components

Return type:iterable(str)
get_structural_parameters_sdram_usage_in_bytes(application_graph, app_vertex, n_neurons, n_synapse_types)[source]

Get the size of the structural parameters

get_vertex_executable_suffix()[source]

Get the executable suffix for a vertex for this dynamics

get_weight_maximum(connector, synapse_info)[source]

Get the maximum weight for the synapses

get_weight_mean(connector, synapse_info)[source]

Get the mean weight for the synapses

initial_delay

The delay of a formed connection

initial_weight

The weight of a formed connection

is_same_as(synapse_dynamics)[source]

Determines if this synapse dynamics is the same as another

merge(synapse_dynamics)[source]

Merge with the given synapse_dynamics and return the result, or error if merge is not possible

partner_selection

The partner selection rule

s_max

The maximum number of synapses

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

set_projection_parameter(param, value)[source]
write_structural_parameters(spec, region, machine_time_step, weight_scales, application_graph, app_vertex, post_slice, graph_mapper, routing_info, synapse_indices)[source]

Write structural plasticity parameters

Module contents

class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractSynapseDynamics[source]

Bases: object

NUMPY_CONNECTORS_DTYPE = [('source', 'uint32'), ('target', 'uint32'), ('weight', 'float64'), ('delay', 'float64')]
are_weights_signed()[source]

Determines if the weights are signed values

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)[source]

Converts per-connection data generated from connections into row-based data to be returned from get_synaptic_data

delay

The delay of connections

get_delay_maximum(connector, synapse_info)[source]

Get the maximum delay for the synapses

get_delay_variance(connector, delays)[source]

Get the variance in delay for the synapses

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

get_parameter_names()[source]

Get the parameter names available from the synapse dynamics components

Return type:iterable(str)
get_parameters_sdram_usage_in_bytes(n_neurons, n_synapse_types)[source]

Get the SDRAM usage of the synapse dynamics parameters in bytes

get_provenance_data(pre_population_label, post_population_label)[source]

Get the provenance data from this synapse dynamics object

get_vertex_executable_suffix()[source]

Get the executable suffix for a vertex for this dynamics

get_weight_maximum(connector, synapse_info)[source]

Get the maximum weight for the synapses

get_weight_mean(connector, synapse_info)[source]

Get the mean weight for the synapses

get_weight_variance(connector, weights)[source]

Get the variance in weight for the synapses

get_words(rows)[source]

Convert the row data to words

is_same_as(synapse_dynamics)[source]

Determines if this synapse dynamics is the same as another

merge(synapse_dynamics)[source]

Merge with the given synapse_dynamics and return the result, or error if merge is not possible

set_delay(delay)[source]

Set the delay

weight

The weight of connections

write_parameters(spec, region, machine_time_step, weight_scales)[source]

Write the synapse parameters to the spec

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:numpy array of 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.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

get_n_synapses_in_rows(ff_size)[source]

Get the number of synapses in the rows with sizes ff_size

get_n_words_for_static_connections(n_connections)[source]

Get the number of 32-bit words for n_connections in a single row

get_static_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types)[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.

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

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

get_n_plastic_plastic_words_per_row(pp_size)[source]

Get the number of plastic plastic words to be read from each row

get_n_synapses_in_rows(pp_size, fp_size)[source]

Get the number of synapses in each of the rows with plastic sizes pp_size and fp_size

get_n_words_for_plastic_connections(n_connections)[source]

Get the number of 32-bit words for n_connections in a single row

get_plastic_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types)[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.

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

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=1.0, 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

are_weights_signed()[source]

Determines if the weights are signed values

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

get_n_synapses_in_rows(ff_size)[source]

Get the number of synapses in the rows with sizes ff_size

get_n_words_for_static_connections(n_connections)[source]

Get the number of 32-bit words for n_connections in a single row

get_parameter_names()[source]

Get the parameter names available from the synapse dynamics components

Return type:iterable(str)
get_parameters_sdram_usage_in_bytes(n_neurons, n_synapse_types)[source]

Get the SDRAM usage of the synapse dynamics parameters in bytes

get_static_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types)[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.

get_value(key)[source]

Get a property Get a property

get_vertex_executable_suffix()[source]

Get the executable suffix for a vertex for this dynamics

is_same_as(synapse_dynamics)[source]

Determines if this synapse dynamics is the same as another

mark_no_changes()[source]

Marks the point after which changes are reported, so that new changes can be detected before the next check. 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

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

requires_mapping

True if changes that have been made require that mapping be performed. By default this returns False but can be overridden to indicate changes that require mapping.

Return type:bool 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 – the name of the parameter to change
  • value – the new value of the parameter to assign Set a property
  • key – the name of the parameter to change
  • value – the new value of the parameter to assign
weight

The weight of connections

write_parameters(spec, region, machine_time_step, weight_scales)[source]

Write the synapse parameters to the spec

class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsSTDP(timing_dependence=None, weight_dependence=None, voltage_dependence=None, dendritic_delay_fraction=1.0, weight=0.0, delay=1.0, 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

are_weights_signed()[source]

Determines if the weights are signed values

backprop_delay
changes_during_run

Determine if the synapses change during a run

Return type:bool
delay

The delay of connections

dendritic_delay_fraction
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:numpy array of 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 – 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

get_n_plastic_plastic_words_per_row(pp_size)[source]

Get the number of plastic plastic words to be read from each row

get_n_synapses_in_rows(pp_size, fp_size)[source]

Get the number of synapses in each of the rows with plastic sizes pp_size and fp_size

get_n_words_for_plastic_connections(n_connections)[source]

Get the number of 32-bit words for n_connections in a single row

get_parameter_names()[source]

Get the parameter names available from the synapse dynamics components

Return type:iterable(str)
get_parameters_sdram_usage_in_bytes(n_neurons, n_synapse_types)[source]

Get the SDRAM usage of the synapse dynamics parameters in bytes

get_plastic_synaptic_data(connections, connection_row_indices, n_rows, post_vertex_slice, n_synapse_types)[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.

get_provenance_data(pre_population_label, post_population_label)[source]

Get the provenance data from this synapse dynamics object

get_value(key)[source]

Get a property Get a property

get_vertex_executable_suffix()[source]

Get the executable suffix for a vertex for this dynamics

get_weight_maximum(connector, synapse_info)[source]

Get the maximum weight for the synapses

get_weight_mean(connector, synapse_info)[source]

Get the mean weight for the synapses

get_weight_variance(connector, weights)[source]

Get the variance in weight for the synapses

is_same_as(synapse_dynamics)[source]

Determines if this synapse dynamics is the same as another

mark_no_changes()[source]

Marks the point after which changes are reported, so that new changes can be detected before the next check. 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

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

requires_mapping

True if changes that have been made require that mapping be performed. By default this returns False but can be overridden to indicate changes that require mapping.

Return type:bool 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 – the name of the parameter to change
  • value – the new value of the parameter to assign Set a property
  • key – the name of the parameter to change
  • value – the new value of the parameter to assign
timing_dependence
weight

The weight of connections

weight_dependence
write_parameters(spec, region, machine_time_step, weight_scales)[source]

Write the synapse parameters to the spec

class spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractSynapseDynamicsStructural[source]

Bases: object

elimination

The elimination rule

f_rew

The frequency of rewiring

formation

The formation rule

get_structural_parameters_sdram_usage_in_bytes(application_graph, app_vertex, n_neurons, n_synapse_types)[source]

Get the size of the structural parameters

initial_delay

The delay of a formed connection

initial_weight

The weight of a formed connection

partner_selection

The partner selection rule

s_max

The maximum number of synapses

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

write_structural_parameters(spec, region, machine_time_step, weight_scales, application_graph, app_vertex, post_slice, graph_mapper, routing_info, synapse_indices)[source]

Write structural plasticity parameters

class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsStructuralCommon(partner_selection, formation, elimination, f_rew, initial_weight, initial_delay, s_max, seed)[source]

Bases: object

Utility class that holds properties of synaptic rewiring both in the presence and absence of STDP.

Written by Petrut Bogdan.

Parameters:
  • partner_selection – The partner selection rule
  • formation – The formation rule
  • elimination – The elimination rule
  • f_rew (int) – How many rewiring attempts will be done per second.
  • initial_weight (float) – Initial weight assigned to a newly formed connection
  • initial_delay (int or (int, int)) – Delay assigned to a newly formed connection
  • s_max (int) – Maximum fan-in per target layer neuron
  • seed (int) – seed the random number generators
DEFAULT_F_REW = 10000
DEFAULT_INITIAL_DELAY = 1
DEFAULT_INITIAL_WEIGHT = 0
DEFAULT_S_MAX = 32
KEY_ATOM_INFO_SIZE = 20
POST_TO_PRE_ENTRY_SIZE = 4
PRE_POP_INFO_BASE_SIZE = 20
REWIRING_DATA_SIZE = 64
actual_sdram_usage

Actual SDRAM usage (based on what is written to spec).

Returns:actual SDRAM usage
Return type:int
elimination
f_rew
formation
get_parameter_names()[source]
get_parameters_sdram_usage_in_bytes(application_graph, app_vertex, n_neurons)[source]

Get SDRAM usage

Returns:SDRAM usage
Return type:int
get_vertex_executable_suffix()[source]
initial_delay
initial_weight
is_same_as(synapse_dynamics)[source]
n_words_for_plastic_connections(value)[source]

Set size of plastic connections in words

n_words_for_static_connections(value)[source]

Set size of static connections in words

p_rew

The period of rewiring.

Returns:The period of rewiring
Return type:int
partner_selection
s_max
seed
set_projection_parameter(param, value)[source]
synaptic_data_update(connections, post_vertex_slice, app_edge, synapse_info, machine_edge)[source]

Set synaptic data

write_parameters(spec, region, machine_time_step, weight_scales, application_graph, app_vertex, post_slice, graph_mapper, routing_info, synapse_indices)[source]

Write the synapse parameters to the spec.

class spynnaker.pyNN.models.neuron.synapse_dynamics.SynapseDynamicsStructuralStatic(partner_selection, formation, elimination, f_rew=10000, initial_weight=0, initial_delay=1, s_max=32, seed=None, weight=0.0, delay=1.0)[source]

Bases: spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_static.SynapseDynamicsStatic, spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_synapse_dynamics_structural.AbstractSynapseDynamicsStructural

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 – The partner selection rule
  • formation – The formation rule
  • elimination – The elimination rule
  • f_rew (int) – 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
  • seed (int) – seed the random number generators
  • weight – The weight of connections formed by the connector
  • delay – The delay of connections formed by the connector
changes_during_run

Determine if the synapses change during a run

Return type:bool
elimination

The elimination rule

f_rew

The frequency of rewiring

formation

The formation rule

get_n_words_for_static_connections(n_connections)[source]

Get the number of 32-bit words for n_connections in a single row

get_parameter_names()[source]

Get the parameter names available from the synapse dynamics components

Return type:iterable(str)
get_structural_parameters_sdram_usage_in_bytes(application_graph, app_vertex, n_neurons, n_synapse_types)[source]

Get the size of the structural parameters

get_vertex_executable_suffix()[source]

Get the executable suffix for a vertex for this dynamics

get_weight_maximum(connector, synapse_info)[source]

Get the maximum weight for the synapses

get_weight_mean(connector, synapse_info)[source]

Get the mean weight for the synapses

get_weight_variance(connector, weights)[source]

Get the variance in weight for the synapses

initial_delay

The delay of a formed connection

initial_weight

The weight of a formed connection

is_same_as(synapse_dynamics)[source]

Determines if this synapse dynamics is the same as another

merge(synapse_dynamics)[source]

Merge with the given synapse_dynamics and return the result, or error if merge is not possible

partner_selection

The partner selection rule

s_max

The maximum number of synapses

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

set_projection_parameter(param, value)[source]
write_structural_parameters(spec, region, machine_time_step, weight_scales, application_graph, app_vertex, post_slice, graph_mapper, routing_info, synapse_indices)[source]

Write structural plasticity parameters

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, initial_weight=0, initial_delay=1, s_max=32, seed=None, weight=0.0, delay=1.0, backprop_delay=True)[source]

Bases: spynnaker.pyNN.models.neuron.synapse_dynamics.synapse_dynamics_stdp.SynapseDynamicsSTDP, spynnaker.pyNN.models.neuron.synapse_dynamics.abstract_synapse_dynamics_structural.AbstractSynapseDynamicsStructural

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 – The partner selection rule
  • formation – The formation rule
  • elimination – The elimination rule
  • timing_dependence – The STDP timing dependence
  • weight_dependence – The STDP weight dependence
  • voltage_dependence – The STDP voltage dependence
  • dendritic_delay_fraction – The STDP dendritic delay fraction
  • f_rew (int) – 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
  • seed (int) – seed the random number generators
  • weight – The weight of connections formed by the connector
  • delay – The delay of connections formed by the connector
elimination

The elimination rule

f_rew

The frequency of rewiring

formation

The formation rule

get_n_words_for_plastic_connections(n_connections)[source]

Get the number of 32-bit words for n_connections in a single row

get_parameter_names()[source]

Get the parameter names available from the synapse dynamics components

Return type:iterable(str)
get_structural_parameters_sdram_usage_in_bytes(application_graph, app_vertex, n_neurons, n_synapse_types)[source]

Get the size of the structural parameters

get_vertex_executable_suffix()[source]

Get the executable suffix for a vertex for this dynamics

get_weight_maximum(connector, synapse_info)[source]

Get the maximum weight for the synapses

get_weight_mean(connector, synapse_info)[source]

Get the mean weight for the synapses

initial_delay

The delay of a formed connection

initial_weight

The weight of a formed connection

is_same_as(synapse_dynamics)[source]

Determines if this synapse dynamics is the same as another

merge(synapse_dynamics)[source]

Merge with the given synapse_dynamics and return the result, or error if merge is not possible

partner_selection

The partner selection rule

s_max

The maximum number of synapses

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

set_projection_parameter(param, value)[source]
write_structural_parameters(spec, region, machine_time_step, weight_scales, application_graph, app_vertex, post_slice, graph_mapper, routing_info, synapse_indices)[source]

Write structural plasticity parameters