spynnaker8.models package

Subpackages

Submodules

spynnaker8.models.data_cache module

class spynnaker8.models.data_cache.DataCache(label, description, segment_number, recording_start_time, t)[source]

Bases: object

Storage object to hold all the data to (re)create a Neo Segment

Note

Required because deep-copy does not work on neo Objects

Stores the Data shared by all variable types at the top level and holds a cache for the variable specific data

Parameters:
  • label – cache label
  • description – cache description
  • segment_number – cache segment number
  • recording_start_time – when this cache was started in recording space.
  • t – time
description
get_data(variable)[source]

Get the variable cache for the named variable

Parameters:variable – name of variable to get cache for
Rtype variable:str
Returns:The cache data, IDs, indexes and units
Return type:VariableCache
has_data(variable)[source]

Checks if data for a variable has been cached

Parameters:variable (str) – Name of variable
Returns:True if there is cached data
Return type:bool
label
rec_datetime
recording_start_time
save_data(variable, data, indexes, n_neurons, units, sampling_interval)[source]

Saves the data for one variable in this segment

Parameters:
  • variable (str) – name of variable data applies to
  • data (nparray) – raw data in sPyNNaker format
  • indexes (nparray) – population indexes for which data should be returned
  • n_neurons (int) – Number of neurons in the population. Regardless of if they where recording or not.
  • units (str) – the units in which the data is
Return type:

None

segment_number
t
variables

Provides a list of which variables data has been cached for

Return type:Iterator (str)

spynnaker8.models.projection module

class spynnaker8.models.projection.Projection(pre_synaptic_population, post_synaptic_population, connector, synapse_type=None, source=None, receptor_type=None, space=None, label=None)[source]

Bases: spynnaker.pyNN.models.pynn_projection_common.PyNNProjectionCommon

sPyNNaker 8 projection class

get(attribute_names, format, gather=True, with_address=True, multiple_synapses='last')[source]

Get a parameter for PyNN 0.8

Parameters:
  • attribute_names (str or iterable(str)) – list of attributes to gather
  • format – “list” or “array”
  • gather – gather over all nodes (defaulted to true on SpiNNaker)
  • with_address – True if the source and target are to be included
  • multiple_synapses – What to do with the data if format=”array” and if the multiple source-target pairs with the same values exist. Currently only “last” is supported
Returns:

values selected

getDelays(format='list', gather=True)[source]
getSynapseDynamics(parameter_name, format='list', gather=True)[source]
getWeights(format='list', gather=True)[source]
label
post
pre
printDelays(file, format='list', gather=True)[source]

Print synaptic weights to file. In the array format, zeros are printed for non-existent connections.

printWeights(file, format='list', gather=True)[source]
save(attribute_names, file, format='list', gather=True, with_address=True)[source]

Print synaptic attributes (weights, delays, etc.) to file. In the array format, zeros are printed for non-existent connections. Values will be expressed in the standard PyNN units (i.e., millivolts, nanoamps, milliseconds, microsiemens, nanofarads, event per second).

saveConnections(file, gather=True, compatible_output=True)[source]
set(**attributes)[source]
weightHistogram(min=None, max=None, nbins=10)[source]

Return a histogram of synaptic weights. If min and max are not given, the minimum and maximum weights are calculated automatically.

spynnaker8.models.recorder module

class spynnaker8.models.recorder.Recorder(population)[source]

Bases: spynnaker.pyNN.models.recording_common.RecordingCommon

cache_data()[source]

Store data for later extraction

read_in_signal(segment, block, signal_array, data_indexes, view_indexes, variable, recording_start_time, sampling_interval, units, label)[source]

Reads in a data item that’s not spikes (likely v, gsyn e, gsyn i) and saves this data to the segment.

Parameters:
  • segment (neo.Segment) – Segment to add data to
  • block (neo.Block) – neo block
  • signal_array (nparray) – the raw signal data
  • data_indexes (list(int)) – The indexes for the recorded data
  • view_indexes (list(int)) – The indexes for which data should be returned. If None all data (view_index = data_indexes)
  • variable – the variable name
  • recording_start_time – when recording started
  • sampling_interval – how often a neuron is recorded
  • units – the units of the recorded value
  • label – human readable label
read_in_spikes(segment, spikes, t, n_neurons, recording_start_time, sampling_interval, indexes, label)[source]

Converts the data into SpikeTrains and saves them to the segment.

Parameters:
  • segment (neo.Segment) – Segment to add spikes to
  • spikes (nparray) – Spike data in raw sPyNNaker format
  • t (int) – last simulation time
  • n_neurons (int) – total number of neurons including ones not recording
  • recording_start_time (int) – time recording started
  • sampling_interval – how often a neuron is recorded
  • label (str) – recording elements label

spynnaker8.models.variable_cache module

class spynnaker8.models.variable_cache.VariableCache(data, indexes, n_neurons, units, sampling_interval)[source]

Bases: object

Simple holder method to keep data, IDs, indexes and units together

Typically used to recreate the Neo object for one type of variable for one segment

Parameters:
  • data (nparray) – raw data in sPyNNaker format
  • indexes (list (int)) – Population indexes for which data was collected
  • n_neurons (int) – Number of neurons in the population, regardless of whether they were recording or not.
  • units (str) – the units in which the data is
data
indexes
n_neurons
sampling_interval
units

Module contents

class spynnaker8.models.Projection(pre_synaptic_population, post_synaptic_population, connector, synapse_type=None, source=None, receptor_type=None, space=None, label=None)[source]

Bases: spynnaker.pyNN.models.pynn_projection_common.PyNNProjectionCommon

sPyNNaker 8 projection class

get(attribute_names, format, gather=True, with_address=True, multiple_synapses='last')[source]

Get a parameter for PyNN 0.8

Parameters:
  • attribute_names (str or iterable(str)) – list of attributes to gather
  • format – “list” or “array”
  • gather – gather over all nodes (defaulted to true on SpiNNaker)
  • with_address – True if the source and target are to be included
  • multiple_synapses – What to do with the data if format=”array” and if the multiple source-target pairs with the same values exist. Currently only “last” is supported
Returns:

values selected

getDelays(format='list', gather=True)[source]
getSynapseDynamics(parameter_name, format='list', gather=True)[source]
getWeights(format='list', gather=True)[source]
label
post
pre
printDelays(file, format='list', gather=True)[source]

Print synaptic weights to file. In the array format, zeros are printed for non-existent connections.

printWeights(file, format='list', gather=True)[source]
save(attribute_names, file, format='list', gather=True, with_address=True)[source]

Print synaptic attributes (weights, delays, etc.) to file. In the array format, zeros are printed for non-existent connections. Values will be expressed in the standard PyNN units (i.e., millivolts, nanoamps, milliseconds, microsiemens, nanofarads, event per second).

saveConnections(file, gather=True, compatible_output=True)[source]
set(**attributes)[source]
weightHistogram(min=None, max=None, nbins=10)[source]

Return a histogram of synaptic weights. If min and max are not given, the minimum and maximum weights are calculated automatically.

class spynnaker8.models.Recorder(population)[source]

Bases: spynnaker.pyNN.models.recording_common.RecordingCommon

cache_data()[source]

Store data for later extraction

read_in_signal(segment, block, signal_array, data_indexes, view_indexes, variable, recording_start_time, sampling_interval, units, label)[source]

Reads in a data item that’s not spikes (likely v, gsyn e, gsyn i) and saves this data to the segment.

Parameters:
  • segment (neo.Segment) – Segment to add data to
  • block (neo.Block) – neo block
  • signal_array (nparray) – the raw signal data
  • data_indexes (list(int)) – The indexes for the recorded data
  • view_indexes (list(int)) – The indexes for which data should be returned. If None all data (view_index = data_indexes)
  • variable – the variable name
  • recording_start_time – when recording started
  • sampling_interval – how often a neuron is recorded
  • units – the units of the recorded value
  • label – human readable label
read_in_spikes(segment, spikes, t, n_neurons, recording_start_time, sampling_interval, indexes, label)[source]

Converts the data into SpikeTrains and saves them to the segment.

Parameters:
  • segment (neo.Segment) – Segment to add spikes to
  • spikes (nparray) – Spike data in raw sPyNNaker format
  • t (int) – last simulation time
  • n_neurons (int) – total number of neurons including ones not recording
  • recording_start_time (int) – time recording started
  • sampling_interval – how often a neuron is recorded
  • label (str) – recording elements label