spynnaker.pyNN.utilities package

Submodules

spynnaker.pyNN.utilities.constants module

class spynnaker.pyNN.utilities.constants.POPULATION_BASED_REGIONS[source]

Bases: enum.Enum

Regions for populations.

CONNECTOR_BUILDER = 9
DIRECT_MATRIX = 10
NEURON_PARAMS = 1
POPULATION_TABLE = 3
PROFILING = 8
PROVENANCE_DATA = 7
RECORDING = 6
SYNAPSE_DYNAMICS = 5
SYNAPSE_PARAMS = 2
SYNAPTIC_MATRIX = 4
SYSTEM = 0

spynnaker.pyNN.utilities.extracted_data module

class spynnaker.pyNN.utilities.extracted_data.ExtractedData[source]

Bases: object

Data holder for all synaptic data being extracted in parallel. @Chimp: play here to hearts content.

get(projection, attribute)[source]

Allow getting data from a given projection and attribute

Parameters:
  • projection – the projection data was extracted from
  • attribute – the attribute to retrieve
Returns:

the attribute data in a connection holder

set(projection, attribute, data)[source]

Allow the addition of data from a projection and attribute.

Parameters:
  • projection – the projection data was extracted from
  • attribute – the attribute to store
  • data – attribute data in a connection holder
Return type:

None

spynnaker.pyNN.utilities.fake_HBP_Portal_machine_provider module

class spynnaker.pyNN.utilities.fake_HBP_Portal_machine_provider.FakeHBPPortalMachineProvider(n_boards, config)[source]

Bases: object

create()[source]
destroy()[source]
get_machine_info()[source]
wait_till_not_ready()[source]
wait_until_ready()[source]

spynnaker.pyNN.utilities.reports module

spynnaker.pyNN.utilities.running_stats module

class spynnaker.pyNN.utilities.running_stats.RunningStats[source]

Bases: object

Keeps running statistics From: http://www.johndcook.com/blog/skewness_kurtosis/

add_item(x)[source]
add_items(mean, variance, n_items)[source]
mean
n_items
standard_deviation
variance

spynnaker.pyNN.utilities.spynnaker_connection_holder_generations module

class spynnaker.pyNN.utilities.spynnaker_connection_holder_generations.SpYNNakerConnectionHolderGenerator[source]

Bases: object

Sets up connection holders for reports to use.

spynnaker.pyNN.utilities.spynnaker_failed_state module

class spynnaker.pyNN.utilities.spynnaker_failed_state.SpynnakerFailedState[source]

Bases: spynnaker.pyNN.spynnaker_simulator_interface.SpynnakerSimulatorInterface, spinn_front_end_common.utilities.failed_state.FailedState, object

get_current_time()[source]
get_distribution_to_stats()[source]
get_pynn_NumpyRNG()[source]
get_random_distribution()[source]
has_reset_last
is_a_pynn_random(thing)[source]
max_delay
min_delay
static reset(annotations=None)[source]
set_number_of_neurons_per_core(neuron_type, max_permitted)[source]

spynnaker.pyNN.utilities.spynnaker_neuron_network_specification_report module

class spynnaker.pyNN.utilities.spynnaker_neuron_network_specification_report.SpYNNakerNeuronGraphNetworkSpecificationReport[source]

Bases: object

spynnaker.pyNN.utilities.spynnaker_synaptic_matrix_report module

class spynnaker.pyNN.utilities.spynnaker_synaptic_matrix_report.SpYNNakerSynapticMatrixReport[source]

Bases: object

Generate the synaptic matrix for reporting purposes

spynnaker.pyNN.utilities.utility_calls module

utility class containing simple helper methods

spynnaker.pyNN.utilities.utility_calls.check_directory_exists_and_create_if_not(filename)[source]

Create a parent directory for a file if it doesn’t exist

Parameters:filename – The file whose parent directory is to be created
spynnaker.pyNN.utilities.utility_calls.check_sampling_interval(sampling_interval)[source]
spynnaker.pyNN.utilities.utility_calls.convert_param_to_numpy(param, no_atoms)[source]

Convert parameters into numpy arrays

Parameters:
  • param – the param to convert
  • no_atoms – the number of atoms available for conversion of param
Return numpy.array:
 

the converted param in whatever format it was given

spynnaker.pyNN.utilities.utility_calls.convert_to(value, data_type)[source]

Convert a value to a given data type

Parameters:
  • value – The value to convert
  • data_type – The data type to convert to
Returns:

The converted data as a numpy data type

spynnaker.pyNN.utilities.utility_calls.get_maximum_probable_value(dist, n_items, chance=0.01)[source]

Get the likely maximum value of a RandomDistribution given a number of draws

spynnaker.pyNN.utilities.utility_calls.get_mean(dist)[source]

Get the mean of a RandomDistribution

spynnaker.pyNN.utilities.utility_calls.get_minimum_probable_value(dist, n_items, chance=0.01)[source]

Get the likely minimum value of a RandomDistribution given a number of draws

spynnaker.pyNN.utilities.utility_calls.get_n_bits(n_values)[source]

Determine how many bits are required for the given number of values

spynnaker.pyNN.utilities.utility_calls.get_probability_within_range(dist, lower, upper)[source]

Get the probability that a value will fall within the given range for a given RandomDistribution

spynnaker.pyNN.utilities.utility_calls.get_probable_maximum_selected(n_total_trials, n_trials, selection_prob, chance=0.01)[source]

Get the likely maximum number of items that will be selected from a set of n_trials from a total set of n_total_trials with a probability of selection of selection_prob

spynnaker.pyNN.utilities.utility_calls.get_standard_deviation(dist)[source]

Get the standard deviation of a RandomDistribution

spynnaker.pyNN.utilities.utility_calls.get_variance(dist)[source]

Get the variance of a RandomDistribution

spynnaker.pyNN.utilities.utility_calls.high(dist)[source]

Gets the high or max boundary value for this distribution

Could return None

spynnaker.pyNN.utilities.utility_calls.low(dist)[source]

Gets the high or min boundary value for this distribution

Could return None

spynnaker.pyNN.utilities.utility_calls.read_in_data_from_file(file_path, min_atom, max_atom, min_time, max_time, extra=False)[source]
Read in a file of data values where the values are in a format of:
<time> <atom ID> <data value>
Parameters:
  • file_path – absolute path to a file containing the data
  • min_atom – min neuron ID to which neurons to read in
  • max_atom – max neuron ID to which neurons to read in
  • min_time – min time slot to read neurons values of.
  • max_time – max time slot to read neurons values of.
Returns:

a numpy array of (time stamp, atom ID, data value)

spynnaker.pyNN.utilities.utility_calls.read_spikes_from_file(file_path, min_atom=0, max_atom=inf, min_time=0, max_time=inf, split_value='\t')[source]

Read spikes from a file formatted as: <time> <neuron ID>

Parameters:
  • file_path (str) – absolute path to a file containing spike values
  • min_atom (int) – min neuron ID to which neurons to read in
  • max_atom (int) – max neuron ID to which neurons to read in
  • min_time (int) – min time slot to read neurons values of.
  • max_time (int) – max time slot to read neurons values of.
  • split_value (str) – the pattern to split by
Returns:

a numpy array with max_atom elements each of which is a list of spike times.

Return type:

numpy.array(int, int)

spynnaker.pyNN.utilities.utility_calls.validate_mars_kiss_64_seed(seed)[source]

Update the seed to make it compatible with the rng algorithm

Module contents