spynnaker.pyNN.models package¶
Subpackages¶
- spynnaker.pyNN.models.abstract_models package
- spynnaker.pyNN.models.common package
- spynnaker.pyNN.models.neural_projections package
- spynnaker.pyNN.models.neural_properties package
- spynnaker.pyNN.models.neuron package
- Subpackages
- spynnaker.pyNN.models.neuron.additional_inputs package
- spynnaker.pyNN.models.neuron.builds package
- spynnaker.pyNN.models.neuron.implementations package
- spynnaker.pyNN.models.neuron.input_types package
- spynnaker.pyNN.models.neuron.neuron_models package
- spynnaker.pyNN.models.neuron.plasticity package
- spynnaker.pyNN.models.neuron.structural_plasticity package
- Subpackages
- spynnaker.pyNN.models.neuron.structural_plasticity.synaptogenesis package
- Module contents
- Subpackages
- spynnaker.pyNN.models.neuron.synapse_dynamics package
- spynnaker.pyNN.models.neuron.synapse_types package
- spynnaker.pyNN.models.neuron.threshold_types package
- Submodules
- spynnaker.pyNN.models.neuron.key_space_tracker module
- spynnaker.pyNN.models.neuron.master_pop_table module
- spynnaker.pyNN.models.neuron.synapse_io module
- spynnaker.pyNN.models.neuron.synaptic_matrices module
- spynnaker.pyNN.models.neuron.synaptic_matrix module
- spynnaker.pyNN.models.neuron.synaptic_matrix_app module
- Module contents
- Subpackages
- spynnaker.pyNN.models.populations package
- spynnaker.pyNN.models.spike_source package
- spynnaker.pyNN.models.utility_models package
Submodules¶
spynnaker.pyNN.models.abstract_pynn_model module¶
-
class
spynnaker.pyNN.models.abstract_pynn_model.
AbstractPyNNModel
[source]¶ Bases:
object
A Model that can be passed in to a Population object in PyNN
-
create_vertex
(n_neurons, label, constraints)[source]¶ Create a vertex for a population of the model
Parameters: - n_neurons (int) – The number of neurons in the population
- label (str) – The label to give to the vertex
- constraints (list(AbstractConstraint) or None) – A list of constraints to give to the vertex, or None
Returns: An application vertex for the population
Return type:
-
default_initial_values
= {}¶
-
default_parameters
= {}¶
-
default_population_parameters
¶ - Get the default values for the parameters at the population level
- These are parameters that can be passed in to the Population constructor in addition to the standard PyNN options
Return type: dict(str, Any)
-
classmethod
get_max_atoms_per_core
()[source]¶ Get the maximum number of atoms per core for this model
Return type: int
-
classmethod
get_parameter_names
()[source]¶ Get the names of the parameters of the model
Return type: list(str)
-
spynnaker.pyNN.models.defaults module¶
-
spynnaker.pyNN.models.defaults.
default_initial_values
(state_variables)[source]¶ Specifies arguments which are state variables. Only works on the
__init__
method of a class that is additionally decorated withdefaults()
Parameters: state_variables (iterable(str)) – The names of the arguments that are state variables
-
spynnaker.pyNN.models.defaults.
default_parameters
(parameters)[source]¶ Specifies arguments which are parameters. Only works on the
__init__
method of a class that is additionally decorated withdefaults()
Parameters: parameters (iterable(str)) – The names of the arguments that are parameters
-
spynnaker.pyNN.models.defaults.
defaults
(cls)[source]¶ Get the default parameters and state variables from the arguments to the
__init__
method. This uses the decoratorsdefault_parameters()
anddefault_initial_values()
to determine the parameters and state variables respectively. If only one is specified, the other is assumed to be the remaining arguments. If neither are specified, it is assumed that all default arguments are parameters.
spynnaker.pyNN.models.projection module¶
-
class
spynnaker.pyNN.models.projection.
Projection
(pre_synaptic_population, post_synaptic_population, connector, synapse_type=None, source=None, receptor_type=None, space=None, label=None)[source]¶ Bases:
object
A container for all the connections of a given type (same synapse type and plasticity mechanisms) between two populations, together with methods to set parameters of those connections, including of plasticity mechanisms.
Parameters: - pre_synaptic_population (PopulationBase) –
- post_synaptic_population (PopulationBase) –
- connector (AbstractConnector) –
- synapse_type (AbstractSynapseDynamics) –
- source (None) – Unsupported; must be None
- receptor_type (str) –
- space (Space) –
- label (str) –
-
get
(attribute_names, format, gather=True, with_address=True, multiple_synapses='last')[source]¶ Get a parameter/attribute of the projection.
Note
SpiNNaker always gathers.
Parameters: - attribute_names (str or iterable(str)) – list of attributes to gather
- format (str) –
"list"
or"array"
- gather (bool) – gather over all nodes
- with_address (bool) – True if the source and target are to be included
- multiple_synapses (str) – 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]¶ Deprecated since version 5.0: Use
get('delay')
instead.
-
getSynapseDynamics
(parameter_name, format='list', gather=True)[source]¶ Deprecated since version 5.0: Use
get(parameter_name)
instead.
-
getWeights
(format='list', gather=True)[source]¶ Deprecated since version 5.0: Use
get('weight')
instead.
-
post
¶ The post-population or population view.
Return type: PopulationBase
-
pre
¶ The pre-population or population view.
Return type: PopulationBase
-
printDelays
(file, format='list', gather=True)[source]¶ Deprecated since version 5.0: Use
save('delay')
instead.Print synaptic weights to file. In the array format, zeros are printed for non-existent connections.
-
printWeights
(file, format='list', gather=True)[source]¶ Deprecated since version 5.0: Use
save('weight')
instead.
-
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).
Note
SpiNNaker always gathers.
Parameters:
-
saveConnections
(file, gather=True, compatible_output=True)[source]¶ Deprecated since version 5.0: Use
save('all')
instead.
spynnaker.pyNN.models.recorder module¶
-
class
spynnaker.pyNN.models.recorder.
Recorder
(population, vertex)[source]¶ Bases:
object
Object to hold recording behaviour, used by populations.
Parameters: - population (Population) – the population to record for
- vertex (ApplicationVertex) – the SpiNNaker graph vertex used by the population
-
extract_neo_block
(variables, view_indexes, clear, annotations)[source]¶ Extracts block from the vertices and puts them into a Neo block
Parameters: Returns: The Neo block
Return type:
-
get_all_possible_recordable_variables
()[source]¶ All variables that could be recorded.
Return type: set(str)
-
get_all_recording_variables
()[source]¶ All variables that have been set to record.
Return type: set(str)
-
get_events
(variable)[source]¶ How to get rewiring events (of a post-population) from recorder
Returns: the rewires (event times, values) from the underlying vertex Return type: ndarray
-
get_recorded_matrix
(variable)[source]¶ Perform safety checks and get the recorded data from the vertex in matrix format.
Parameters: variable (str) – The variable name to read. Supported variable names are: gsyn_exc
,gsyn_inh
,v
Returns: data, indexes, sampling_interval Return type: tuple(ndarray, list(int), float)
-
get_recorded_pynn7
(variable)[source]¶ Get recorded data in PyNN 0.7 format. Must not be spikes.
Parameters: variable (str) – The name of the variable to get. Supported variable names are: gsyn_exc
,gsyn_inh
,v
Return type: ndarray
-
get_spikes
()[source]¶ How to get spikes (of a population’s neurons) from the recorder.
Returns: the spikes (event times) from the underlying vertex Return type: ndarray
-
record
(variables, to_file, sampling_interval, indexes)[source]¶ Same as record but without non-standard PyNN warning
This method is non-standard PyNN and is intended only to be called by record in a Population, View or Assembly
Parameters: - variables (str or list(str) or None) – either a single variable name or a list of variable
names. For a given celltype class,
celltype.recordable
contains a list of variables that can be recorded for that celltype. Can also beNone
to reset the list of variables. - to_file (io or rawio or str) – a file to automatically record to (optional).
write_data()
will be automatically called when sim.end() is called. - sampling_interval (int) – a value in milliseconds, and an integer multiple of the simulation timestep.
- indexes (None or list(int)) – The indexes of neurons to record from. This is non-standard PyNN and equivalent to creating a view with these indexes and asking the View to record.
- variables (str or list(str) or None) – either a single variable name or a list of variable
names. For a given celltype class,
-
turn_off_all_recording
(indexes=None)[source]¶ Turns off recording, is used by a pop saying
.record()
Parameters: indexes (list or None) –
-
turn_on_record
(variable, sampling_interval=None, to_file=None, indexes=None)[source]¶ Tell the vertex to record data.
Parameters: - variable (str) – The variable to record, supported variables to
record are:
gsyn_exc
,gsyn_inh
,v
,spikes
. - sampling_interval (int) – the interval to record them
- to_file (neo.io.baseio.BaseIO or str or None) – If set, a file to write to (by handle or name)
- indexes (list(int) or None) – List of indexes to record or None for all
- variable (str) – The variable to record, supported variables to
record are: