pynn_brainscales.brainscales2
Modules
Add location_selector and source_location_selector to build-in pyNN connectors. |
|
Implementation of the PyNN API for the neuromorphic BrainScales2 system.
Classes
|
|
|
|
|
|
|
|
|
|
|
Generic enumeration. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
User defined injected configuration |
|
User defined injected readout |
|
|
|
Plasticity rule base class. |
|
A group of neurons all of the same type. |
|
|
|
|
|
Command specifying the type of run to be performed in pynn.run() |
|
|
|
Data class containing further options for spiking calibration. |
|
Data class containing targets for spiking neuron calibration. |
|
Periodic timer information for plasticity rule execution. |
|
Instances are replaced with an appropriate value in Enum class suites. |
Functions
-
pynn_brainscales.brainscales2.
connect
(pre, post, weight=0.0, delay=None, receptor_type=None, p=1, rng=None) Connect a source of spikes to a synaptic target.
source and target can both be individual cells or populations/ assemblies of cells, in which case all possible connections are made with probability p, using either the random number generator supplied, or the default RNG otherwise. Weights should be in nA or µS.
-
pynn_brainscales.brainscales2.
create
(cellclass, cellparams=None, n=1) Create n cells all of the same type.
Returns a Population object.
-
pynn_brainscales.brainscales2.
dataclass
(cls=None, /, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False) Returns the same class as was passed in, with dunder methods added based on the fields defined in the class.
Examines PEP 526 __annotations__ to determine fields.
If init is true, an __init__() method is added to the class. If repr is true, a __repr__() method is added. If order is true, rich comparison dunder methods are added. If unsafe_hash is true, a __hash__() method function is added. If frozen is true, fields may not be assigned to after instance creation.
-
pynn_brainscales.brainscales2.
end
() Do any necessary cleaning up before exiting.
-
pynn_brainscales.brainscales2.
field
(*, default=<dataclasses._MISSING_TYPE object>, default_factory=<dataclasses._MISSING_TYPE object>, init=True, repr=True, hash=None, compare=True, metadata=None) Return an object to identify dataclass fields.
default is the default value of the field. default_factory is a 0-argument function called to initialize a field’s value. If init is True, the field will be a parameter to the class’s __init__() function. If repr is True, the field will be included in the object’s repr(). If hash is True, the field will be included in the object’s hash(). If compare is True, the field will be used in comparison functions. metadata, if specified, must be a mapping which is stored but not otherwise examined by dataclass.
It is an error to specify both default and default_factory.
-
pynn_brainscales.brainscales2.
get_backend_statistics
() → _pygrenade_vx_network.NetworkGraphStatistics Get statistics of placement and routing like amount of time spent and number of hardware entities used. :raises RuntimeError: If the simulator is not active, i.e. pynn.setup()
was not called.
- Raises
RuntimeError – If the routing and placement step were not performed, i.e. pynn.run() was not called.
- Returns
Statistics object.
-
pynn_brainscales.brainscales2.
get_current_time
() Return the current time in the simulation (in milliseconds).
-
pynn_brainscales.brainscales2.
get_execution_time_info
() → _pygrenade_vx_signal_flow.ExecutionTimeInfo Get time information of last execution. :raises RuntimeError: If the simulator is not active, i.e. pynn.setup()
was not called.
- Raises
RuntimeError – If no info is available, i.e. pynn.run() was not called.
- Returns
Time info object.
-
pynn_brainscales.brainscales2.
get_io
(filename) Return a Neo IO instance, guessing the type based on the filename suffix.
-
pynn_brainscales.brainscales2.
get_max_delay
() Return the maximum allowed synaptic delay (in milliseconds).
-
pynn_brainscales.brainscales2.
get_min_delay
() Return the minimum allowed synaptic delay (in milliseconds).
-
pynn_brainscales.brainscales2.
get_post_realtime_read
() → Dict[pyhalco_common.Coordinate, pyhaldls_vx_v3.Container] Get injected read results of after post_realtime section. :return: Dictionary with coordinates as keys and read container as
values.
-
pynn_brainscales.brainscales2.
get_post_realtime_read_ppu_symbols
() → Dict[str, Union[Dict[pyhalco_hicann_dls_vx_v3.HemisphereOnDLS, pyhaldls_vx_v3.PPUMemoryBlock], pylola_vx_v3.ExternalPPUMemoryBlock]] Get injected PPU symbol read results of after inside_realtime_end section. :return: Dictionary with symbol name as keys and read container(s) as
values.
-
pynn_brainscales.brainscales2.
get_pre_realtime_read
() → Dict[pyhalco_common.Coordinate, pyhaldls_vx_v3.Container] Get injected read results of after pre_realtime section. :return: Dictionary with coordinates as keys and read container as
values.
-
pynn_brainscales.brainscales2.
get_time_step
() Return the integration time step (in milliseconds).
-
pynn_brainscales.brainscales2.
initialize
(cells, **initial_values) Set initial values of state variables, e.g. the membrane potential.
- Values passed to initialize() may be:
single numeric values (all neurons set to the same value)
RandomDistribution objects
lists/arrays of numbers of the same size as the population
mapping functions, where a mapping function accepts a single argument (the cell index) and returns a single number.
Values should be expressed in the standard PyNN units (i.e. millivolts, nanoamps, milliseconds, microsiemens, nanofarads, event per second).
Examples:
initialize(cells, v=-70.0) initialize(cells, v=rand_distr, gsyn_exc=0.0) initialize(cells, v=lambda i: -65 + i/10.0)
-
pynn_brainscales.brainscales2.
list_standard_models
() Return a list of all the StandardCellType classes available for this simulator.
-
pynn_brainscales.brainscales2.
num_processes
() Return the number of MPI processes.
-
pynn_brainscales.brainscales2.
preprocess
() Does the same as pyNN.run(pyNN.RunCommand.PREPARE). Exists only due to backwards-compatibility reasons.
-
pynn_brainscales.brainscales2.
rank
() Return the MPI rank of the current node.
-
pynn_brainscales.brainscales2.
record
(variables, source, filename, sampling_interval=None, annotations=None) Record variables to a file. source can be an individual cell, a Population, PopulationView or Assembly.
-
pynn_brainscales.brainscales2.
reset
(annotations={}) Reset the time to zero, neuron membrane potentials and synaptic weights to their initial values, and begin a new Segment for recorded data. The network structure is not changed, nor are neuron/synapse parameters, nor the specification of which neurons to record from.
-
pynn_brainscales.brainscales2.
run
(runtime: Optional[float], command: pynn_brainscales.brainscales2.RunCommand = <RunCommand.EXECUTE: 3>) Take different actions according to the value passed for command:
For command=pyNN.RunCommand.PREPARE: Execute all steps needed for the hardware back-end. Includes place&route of network graph or execution of calibration. Can be called manually to obtain calibration results for e.g. CalibHXNeuron and make adjustments if needed. If not called manually is automatically called on command=pyNN.RunCommand.APPEND.
For command=pyNN.RunCommand.APPEND: Make a snapshot of the current network configuration and cache it together with the according runtime, for which the system shall evolve in this configuration. Append snippet (=certain network description valid for certain duration) to currently scheduled experiment.
For command=pyNN.RunCommand.EXECUTE: Execute the experiment that was already scheduled by using command=pyNN.RunCommand.APPEND. Can also append a last snippet to the experiment right before executing the experiment, if a value is passed for runtime.
-
pynn_brainscales.brainscales2.
run_for
(runtime: Optional[float], command: pynn_brainscales.brainscales2.RunCommand = <RunCommand.EXECUTE: 3>) Take different actions according to the value passed for command:
For command=pyNN.RunCommand.PREPARE: Execute all steps needed for the hardware back-end. Includes place&route of network graph or execution of calibration. Can be called manually to obtain calibration results for e.g. CalibHXNeuron and make adjustments if needed. If not called manually is automatically called on command=pyNN.RunCommand.APPEND.
For command=pyNN.RunCommand.APPEND: Make a snapshot of the current network configuration and cache it together with the according runtime, for which the system shall evolve in this configuration. Append snippet (=certain network description valid for certain duration) to currently scheduled experiment.
For command=pyNN.RunCommand.EXECUTE: Execute the experiment that was already scheduled by using command=pyNN.RunCommand.APPEND. Can also append a last snippet to the experiment right before executing the experiment, if a value is passed for runtime.
-
pynn_brainscales.brainscales2.
run_until
(time_point, callbacks=None) Advance the simulation until time_point (in ms).
callbacks is an optional list of callables, each of which should accept the current time as an argument, and return the next time it wishes to be called.
run_until()
andrun()
may be combined freely. See the documentation of therun()
function for further information.
-
pynn_brainscales.brainscales2.
set
(cells, **parameters) Set one or more parameters for every cell in a population, view or assembly.
- Values passed to set() may be:
single values
RandomDistribution objects
mapping functions, where a mapping function accepts a single argument (the cell index) and returns a single value.
Here, a “single value” may be either a single number or a list/array of numbers (e.g. for spike times). Values should be expressed in the standard PyNN units (i.e. millivolts, nanoamps, milliseconds, microsiemens, nanofarads, event per second).
-
pynn_brainscales.brainscales2.
setup
(timestep=3.4e-05, min_delay='auto', **extra_params) Should be called at the very beginning of a script. :param extra_params:
most params come from pynn.common.setup neuronPermutation: List providing lookup for custom pyNN neuron to
hardware neuron. Index: HW related population neuron enumeration. Value: HW neuron enumeration. Can be shorter than total HW neuron count. E.g. [2,4,5] results in the first neuron of the first HXNeuron population to be assigned to AtomicNeuronOnDLS(Enum(2)) and so forth.
- backgroundPermutation: List providing lookup for custom pyNN background
spike source to hardware entity. Index: HW related population source enumeration. Value: HW source enumeration. Can be shorter than total HW source count. E.g. [2,3] results in the first population to be assigned to PADIBusOnPADIBusBlock(2) and so forth.
- enable_neuron_bypass: Enable neuron bypass mode: neurons forward spikes
arriving at the synaptic input (i.e. no leaky integration is happening); defaults to False.
- initial_config: Initial configuration of the entire chip. Can for
example be used to manually apply a calibration result.
injected_config: Optional user defined injected configuration. injected_readout: Optional user defined injected readout. calibration_cache: Directory where automated calibration is cached.
If none provided defaults to home cache.
- injected_calib_target: Optional user defined injected calibration
target, which may be partially overwritten by parameters set at populations and projections.
- injected_calib_options: Optional user defined injected calibration
options, which may be partially overwritten by parameters set at populations and projections.
-
pynn_brainscales.brainscales2.
warn
(message, category=None, stacklevel=1, source=None) Issue a warning, or maybe ignore it or raise an exception.