API Reference: PyNN.brainscales2
-
pynn_brainscales.brainscales2.connectors.AllToAllConnector : public pyNN.connectors.AllToAllConnector
Public Functions
-
__init__
(self, allow_self_connections=True, safe=True, callback=None, *location_selector=None, source_location_selector=None)
-
-
pynn_brainscales.brainscales2.connectors.ArrayConnector : public pyNN.connectors.ArrayConnector
Public Functions
-
__init__
(self, array, safe=True, callback=None, *location_selector=None, source_location_selector=None)
-
-
pynn_brainscales.brainscales2.connectors.CloneConnector : public pyNN.connectors.CloneConnector
Public Functions
-
__init__
(self, reference_projection, safe=True, callback=None, *location_selector=None, source_location_selector=None)
-
-
pynn_brainscales.brainscales2.connectors.CSAConnector : public pyNN.connectors.CSAConnector
Public Functions
-
__init__
(self, cset, safe=True, callback=None, *location_selector=None, source_location_selector=None)
-
-
pynn_brainscales.brainscales2.connectors.DisplacementDependentProbabilityConnector : public pyNN.connectors.DisplacementDependentProbabilityConnector
Public Functions
-
__init__
(self, disp_function, allow_self_connections=True, rng=None, safe=True, callback=None, *location_selector=None, source_location_selector=None)
-
-
pynn_brainscales.brainscales2.connectors.DistanceDependentProbabilityConnector : public pyNN.connectors.DistanceDependentProbabilityConnector
Public Functions
-
__init__
(self, d_expression, allow_self_connections=True, rng=None, safe=True, callback=None, *location_selector=None, source_location_selector=None)
-
-
pynn_brainscales.brainscales2.connectors.FixedNumberConnector : public pyNN.connectors.FixedNumberConnector
Subclassed by pynn_brainscales.brainscales2.connectors.FixedNumberPostConnector, pynn_brainscales.brainscales2.connectors.FixedNumberPreConnector
-
pynn_brainscales.brainscales2.connectors.FixedNumberPostConnector : public pyNN.connectors.FixedNumberPostConnector , public pynn_brainscales.brainscales2.connectors.FixedNumberConnector
-
pynn_brainscales.brainscales2.connectors.FixedNumberPreConnector : public pyNN.connectors.FixedNumberPreConnector , public pynn_brainscales.brainscales2.connectors.FixedNumberConnector
-
pynn_brainscales.brainscales2.connectors.FixedProbabilityConnector : public pyNN.connectors.FixedProbabilityConnector
Public Functions
-
__init__
(self, p_connect, allow_self_connections=True, rng=None, safe=True, callback=None, *location_selector=None, source_location_selector=None)
-
-
pynn_brainscales.brainscales2.connectors.FixedTotalNumberConnector : public pyNN.connectors.FixedTotalNumberConnector
Public Functions
-
__init__
(self, n, allow_self_connections=True, with_replacement=True, rng=None, safe=True, callback=None, *location_selector=None, source_location_selector=None)
-
-
pynn_brainscales.brainscales2.connectors.FromFileConnector : public pyNN.connectors.FromFileConnector
Public Functions
-
__init__
(self, file, distributed=False, safe=True, callback=None, *location_selector=None, source_location_selector=None)
-
-
pynn_brainscales.brainscales2.connectors.FromListConnector : public pyNN.connectors.FromListConnector
Public Functions
-
__init__
(self, conn_list, column_names=None, safe=True, callback=None, *location_selector=None, source_location_selector=None)
-
-
pynn_brainscales.brainscales2.connectors.IndexBasedProbabilityConnector : public pyNN.connectors.IndexBasedProbabilityConnector
Public Functions
-
__init__
(self, index_expression, allow_self_connections=True, rng=None, safe=True, callback=None, *location_selector=None, source_location_selector=None)
-
-
pynn_brainscales.brainscales2.connectors.MapConnector : public pyNN.connectors.MapConnector
Subclassed by pynn_brainscales.brainscales2.connectors.OneToOneConnector
-
pynn_brainscales.brainscales2.connectors.OneToOneConnector : public pyNN.connectors.OneToOneConnector , public pynn_brainscales.brainscales2.connectors.MapConnector
-
pynn_brainscales.brainscales2.connectors.SmallWorldConnector : public pyNN.connectors.SmallWorldConnector
-
pynn_brainscales.brainscales2.examples.plasticity_rule.PlasticityRule : public pynn.PlasticityRule
-
class
pynn_brainscales.brainscales2.
InjectedConfiguration
User defined injected configuration.
:param pre_non_realtime: Injection written prior to the non realtime configuration. :param pre_realtime: Injection written prior to the realtime configuration. :param inside_realtime_begin: Injection written prior to the realtime events. :param inside_realtime_end: Injection written after the realtime events and runtime. :param post_realtime: Injection written after the the realtime configuration. :param ppu_symbols: PPU symbol written during static configuration.
Public Static Attributes
-
inside_realtime
= \field(default_factory=sta.AbsoluteTimePlaybackProgramBuilder)
-
inside_realtime_begin
= \field(default_factory=dict)
-
inside_realtime_end
= \field(default_factory=dict)
-
post_realtime
= \field(default_factory=dict)
-
ppu_symbols
= \field(default_factory=dict)
-
pre_non_realtime
= field(default_factory=dict)
-
pre_realtime
= \field(default_factory=dict)
-
-
class
pynn_brainscales.brainscales2.
InjectedReadout
User defined injected readout.
:param pre_realtime: Injection of reads after the the pre_realtime configuration. :param inside_realtime_begin: Injection of reads after the the inside_realtime_begin configuration. :param inside_realtime_end: Injection of reads after the the inside_realtime_end configuration. :param post_realtime: Injection of reads after the the post_realtime configuration. :param ppu_symbols: PPU symbol read after inside_realtime_end.
-
pynn_brainscales.brainscales2.morphology.mc_neuron_base.McNeuronBase : public pynn_brainscales.brainscales2.standardmodels.cells_base.StandardCellType , public ABC
Base class for multi-compartmental neuron models.
Contains the core functionality for multi-compartment neurons. It flattens the hierarchy of a
lola.AtomicNeuron
, for examplelola.AtomicNeuron.multicompartment.i_bias_nmda
is expressed as the parametermulticompartment_i_bias_nmda
. Parameters related to the event routing, configuration of morphology and readout are not exposed since they are determined by other settings in PyNN.A subclass is expected to set the following member variables:
compartments: Dictionary of Compartment Ids and Compartments.
logical_neuron: Configuration of the neuron in form of a logical neuron.
logical_compartments: Shape of the morphology.
Public Functions
-
__init__
(self, **parameters)
-
__init_subclass__
(cls, **kwargs)
-
add_to_chip
(self, List cell_ids, lola.Chip config) Add configuration of each neuron in the parameter space to the give chip object.
:param cell_ids: Cell IDs for each neuron in the parameter space of this celltype object. :param chip: Lola chip object which is altered.
-
apply_config
(self, List[halco.LogicalNeuronOnDLS] coords) Apply configuration initial configuration saved in the simulator state to the parameter space.
:param coords: List of coordinates for which to look up the initial configuration. Needs same order and dimensions as parameter_space.
-
get_compartment_ids
(cls, Sequence[str] labels) Get compartment Ids of compartments with the specified labels.
:param labels: Labels for which to extract the compartment IDs. :return: IDs of compartments for which the given labels match. Note that a single label can match one or more compartment IDS. :raises ValueError: If no compartment can be matched to one of the given labels.
-
get_default_values
(cls)
-
get_label
(cls, halco.CompartmentOnLogicalNeuron compartment_id) Retrieve label of a single compartment.
:param compartment_id: ID of compartment for which to retrieve the label. :return: Label of selected compartment.
-
get_labels
(cls) Retrieve list of all used labels.
:return: List of all used labels.
-
get_logical_neuron
(self, int cell_in_pop) Extract parameters from parameter space and apply it to a logical neuron.
:param cell_in_pop: Index of neuron in population for which to return the configuration as a logical neuron. :return: Configuration of a single neuron in form of a logical neuron.
Public Members
-
default_parameters
Public Static Functions
-
add_to_input_generator
(Population population, grenade.InputGenerator builder) Add external events to input generator.
:param population: Population to add featuring this cell’s celltype. :param builder: Input builder to add external events to.
-
add_to_network_graph
(Population population, grenade.NetworkBuilder builder) Add population to network builder.
:param population: Population to add featuring this cell’s celltype. :param builder: Network builder to add population to. :return: Descriptor of added population
Public Static Attributes
-
compartments
= {}
-
conductance_based
= False
-
injectable
= True
-
logical_compartments
= \halco.LogicalNeuronCompartments()
-
logical_neuron
= lola.LogicalNeuron()
-
receptor_types
= ["excitatory", "inhibitory"]
-
recordable
= ["spikes", "v", "exc_synin", "inh_synin","adaptation"]
-
single_active_circuit
= True
-
translations
-
units
= {"v": "dimensionless", # pylint: disable=invalid-name"exc_synin": "dimensionless","inh_synin": "dimensionless","adaptation": "dimensionless"}
Protected Functions
-
_add_morphology_params_to_ps
(self) Overwrite values in the parameter space with parameters saved for the individual compartments.
Parameters specified during the creation of the morphology should take precedence over values read from calibration. Therefore, these values are extracted from the individual compartments and the parameter space is updated accordingly.
-
_change_all_but_first_circuit
(cls, Any value, Any new_value) Update the values of each compartment and circuit (but the first in each compartment) to the new value.
If
value
is not of type McCircuitParameters,value
is expanded to the shape of the morphology.:param value: Value for which to update all but the first circuits. :param new_value: New value for all but the first circuits. :return:
value
updated such that the first circuits have the same values asvalue
and all other circuits the valuenew_value
.
-
_create_translation
(cls)
-
_update_all_but_first
(self, str name, Any new_value) Update all but the value of the first neuron circuit to the new value.
:param name: Name of parameter in parameter space which will be updated. :param new_value: Value to which to set the parameters.
-
_update_default_parameters
(cls) Determine the default values for each neuron parameter and update class variable
default_parameters
.Overwrite default values of parameters (given by
cls.get_default_values
) with values given for the different compartments. Expand the size of each parameter to fit the number of compartments and number of neuron circuits in each compartment.
Protected Attributes
-
_user_provided_parameters
Protected Static Functions
-
_get_initial_config
(halco.LogicalNeuronOnDLS coord, str param_name) Extract the initial configuration from the simulator state.
:param coord: Coordinate of Logical neuron for which to extract the initial configuration. :param param_name: Name of parameter for which to extract the initial values. :returns: Initial configuration saved in the simulator as McCircuitParameters.
Protected Static Attributes
-
_NON_CONFIGURABLE
= ["event_routing_analog_output","event_routing_enable_digital","leak_reset_i_bias_source_follower","multicompartment_connect_soma","multicompartment_connect_soma_right","multicompartment_connect_right","multicompartment_connect_vertical","multicompartment_enable_conductance","readout_enable_amplifier","readout_source","readout_enable_buffered_access","readout_i_bias"]
-
pynn_brainscales.brainscales2.morphology.parameters.McCircuitParameters : public ArrayParameter
Represents the parameters of a single multi-compartmental neuron.
It saves a parameter value for each compartment and for each neuron circuit in these compartments.
Public Functions
-
__init__
(self, Sequence value) :param value: Nested list with parameter for each neuron circuit.
The outer list is over the different compartments, the inner list over the neuron circuits in each compartment.
-
__eq__
(self, other)
-
max
(self)
Public Members
-
value
-
-
class
pynn_brainscales.brainscales2.morphology.parts.
Compartment
A single iso-potential compartment of a multi-compartmental neuron model.
Public Functions
-
__init__
(self, *List[int] positions, Optional[str] label=None, Optional[List[int]] connect_shared_line=None, Optional[List[Tuple[int, int]]] connect_conductance=None, **parameters) Create a single compartment.
Additional arguments are saved as parameters of the compartment.
:param positions: Enums of AtomicNeuronOnLogicalNeuron which belong to this compartment. :param label: Label of the given compartment. :param connect_shared_line: Enums of AtomicNeuronOnLogicalNeuron for neuron circuits which are directly connected to the shared line. :param connect_conductance: Enums of AtomicNeuronOnLogicalNeuron for neuron circuits which are connected via a resistor to the shared line and their resistance.
-
connect_conductance
(self)
-
connect_conductance
(self, Iterable connect_conductance)
-
connect_shared_line
(self)
-
connect_shared_line
(self, Iterable connect_shared_line)
-
label
(self)
-
label
(self, str label) Check label is a string.
:param label: Label to check.
-
positions
(self)
-
positions
(self, Iterable positions)
-
size
(self)
Protected Static Functions
-
_check_connect_conductance
(Iterable connect_conductance, Iterable positions) Check type and validness of
connect_conductance
:param connect_conductance: Sequence of connect_conductance to check. :param positions: Sequence of positions which belong to the compartment.
Check type and validness of
connect_shared_line
:param connect_shared_line: Sequence of connect_shared_line to check. :param positions: Sequence of positions which belong to the compartment.
-
-
class
pynn_brainscales.brainscales2.plasticity_rules.
PlasticityRule
Plasticity rule base class.
Inheritance is to be used for actual implementations. Periodic timing information is provided via class
Timer
. The kernel implementation is required to be in the form of C++-based PPU kernel code.Subclassed by pynn_brainscales.brainscales2.standardmodels.synapses.StaticRecordingSynapse.RecordingRule
Public Functions
-
__init__
(self, Timer timer, Optional[Dict[str, Union[ObservablePerSynapse, ObservablePerNeuron, ObservableArray]]] observables=None) Create a new plasticity rule with timing information.
:param timer: Timer object.
-
add_to_network_graph
(self, grenade .NetworkBuilder builder)
-
generate_kernel
(self) Generate plasticity rule kernel to be compiled into PPU program.
The interface to be adhered to is the same as in the empty implementation below.
PLASTICITY_RULE_KERNEL
is the generic name of the kernel function, which will be expanded to a unique implementation-defined name upon compilation to allow for multiple kernels.:return: PPU-code of plasticity-rule kernel as string.
-
get_data
(self, grenade.NetworkGraph network_graph, grenade_signal_flow.OutputData outputs) Get synaptic and neuron observables of plasticity rule.
:param network_graph: Network graph to use for lookup of MADC output vertex descriptor. :param outputs: All outputs of a single execution to extract samples from. :return: Recording data.
-
get_observable_array
(self, str observable) Get data for an array observable.
:param observable: Name of observable. :return: Array with recorded data. The array’s entries are values for each timer entry. Each value has a
.data
attribute, containing the recorded data. This data is twice the size set when initializing the observable, since it is added for both top and bottom PPUs.:raises RuntimeError: If observable name is not known. :raises TypeError: If observable is not an ObservableArray.
Public Members
-
changed_since_last_run
Properties
-
observables
= property(_get_observables, _set_observables)
-
timer
= property(_get_timer, _set_timer)
Public Static Attributes
-
ObservableArray
= grenade.PlasticityRule\.TimedRecording.ObservableArray
-
ObservablePerNeuron
= grenade.PlasticityRule\.TimedRecording.ObservablePerNeuron
-
ObservablePerSynapse
= grenade.PlasticityRule\.TimedRecording.ObservablePerSynapse
Protected Functions
-
_add_population
(self, Population new_population)
-
_add_projection
(self, Projection new_projection)
-
_get_observables
(self)
-
_get_timer
(self)
-
_remove_population
(self, Population old_population)
-
_remove_projection
(self, Projection old_projection)
-
_set_observables
(self, new_observables)
-
_set_timer
(self, new_timer)
Protected Static Attributes
-
_simulator
= simulator
-
-
class
pynn_brainscales.brainscales2.plasticity_rules.
PlasticityRuleHandle
Handle to (shared) plasticity rule.
Inheritance is to be used for actual implementations of cell types.
Subclassed by pynn_brainscales.brainscales2.standardmodels.cells_base.NeuronCellType, pynn_brainscales.brainscales2.standardmodels.synapses.PlasticSynapse, pynn_brainscales.brainscales2.standardmodels.synapses.StaticRecordingSynapse
Public Functions
-
__init__
(self, PlasticityRule plasticity_rule=None) Create a new handle to a plasticity rule.
:param plasticity_rule: PlasticityRule instance. :param observable_options: Observable options to use in this cell type instance.
-
to_plasticity_rule_population_handle
(cls, Population population) Convert observable options to population handle of plasticity rule to backend representation, when plasticity rule handle is assoiated to neuron cell type and used in a population.
:param population: Population for which to convert :return: Representation in grenade
-
to_plasticity_rule_projection_handle
(cls, Projection projection) Convert observable options to projection handle of plasticity rule to backend representation, when plasticity rule handle is assoiated to synapse type and used in a projection.
Currently no options are available.
:param projection: Projection for which to convert :return: Representation in grenade
Public Members
-
changed_since_last_run
Properties
-
plasticity_rule
= property(_get_plasticity_rule, _set_plasticity_rule)
Protected Attributes
-
_plasticity_rule
Protected Static Attributes
-
_simulator
= simulator
-
-
class
pynn_brainscales.brainscales2.plasticity_rules.
Timer
Periodic timer information for plasticity rule execution.
Public Members
-
parameters
Properties
-
num_periods
= property(_get_num_periods, _set_num_periods)
-
period
= property(_get_period, _set_period)
-
start
= property(_get_start, _set_start)
-
-
pynn_brainscales.brainscales2.populations.Assembly : public pyNN.common.Assembly
Public Functions
-
record
(self, variables, to_file=None, sampling_interval=None, locations=None, *device="madc") Record the specified variable or variables for all cells in the Assembly.
variables
may be 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.If specified,
to_file
should be either a filename or a Neo IO instance andwrite_data()
will be automatically called whenend()
is called.locations
defines where the variables should be recorded.device
defines the device to use.
Protected Static Attributes
-
_simulator
= simulator
-
-
pynn_brainscales.brainscales2.populations.Population : public pyNN.common.Population
Public Functions
-
__setattr__
(self, name, value)
-
actual_hwparams
(self)
-
calib_hwparams
(self)
-
calib_target
(self)
-
find_units
(self, variable)
-
get_plasticity_data
(self, str observable) Get recorded observable data for this population from plasticity rule.
:raises RuntimeError: On no plasticity rule or requested observable name present :param observable: Observable name to get data for :returns: Observable data per plasticity rule execution period per neuron
-
record
(self, Union[str, List[str]] variables, Optional[Union[str, NixIO]] to_file=None, Optional[float] sampling_interval=None, Optional[List[str]] locations=None, *str device="madc") Record the specified variable or variables for all cells in the Population or view.
:param variables: may be 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. To reset recording of PopulationView or Population callrecord
with “None” as argument.:param to_file: If specified, variables are written to file when
pynn.end()
is called. For more details see :py:function::pynn.population.write_data or pyNN-Doc https://neuralensemble.org/docs/PyNN/data_handling.html:param sampling_interval: Feature not yet implemented.
:param locations: Defines where the variables should be recorded. Used with multi-compartment neurons where location is defined by
label
.:param device: Configures device which is used to record recordables. Default is set to “madc”. Use as device “pad_[0/1]_[unbuffered/buffered]” to connect recordables of neurons to pads. Each of the 2 pads can be connected to one neuron. For limitations see documentation.
Protected Functions
-
_create_cells
(self)
-
_get_parameters
(self, *names) Return a ParameterSpace containing native parameters.
-
_get_view
(self, selector, label=None)
-
_set_initial_value_array
(self, variable, value)
-
_set_parameters
(self, parameter_space) parameter_space should contain native parameters
Protected Attributes
-
_mask_local
Protected Static Attributes
-
_assembly_class
= Assembly
-
_mask_local
= .ndarray
-
_recorder_class
= Recorder
-
_simulator
= simulator
Private Static Attributes
-
__doc__
= pyNN.common.Population.__doc__
-
-
pynn_brainscales.brainscales2.populations.PopulationView : public pyNN.common.PopulationView
-
Public Static Attributes
-
record
= Population.record
-
-
pynn_brainscales.brainscales2.projections.Connection : public pyNN.common.Connection
Store an individual plastic connection and information about it.
Provide an interface that allows access to the connection’s weight, delay and other attributes.
Public Functions
-
__init__
(self, projection, pre_index, post_index, **parameters)
-
as_tuple
(self, *attribute_names)
Public Members
-
changed_since_last_run
-
parameters
-
pop_post_index
-
pop_pre_index
-
postsynaptic_index
-
presynaptic_index
-
projection
-
-
pynn_brainscales.brainscales2.projections.Projection : public pyNN.common.Projection
Public Functions
-
__init__
(self, presynaptic_neurons, postsynaptic_neurons, connector, synapse_type=None, source=None, receptor_type=None, space=Space(), label=None) Create a new projection, connecting the pre- and post-synaptic neurons.
:param presynaptic_neurons: Population, PopulationView or Assembly object.
:param postsynaptic_neurons: Population, PopulationView or Assembly object.
:param connector: a Connector object, encapsulating the algorithm to use for connecting the neurons.
:param synapse_type: a SynapseType object specifying which synaptic connection mechanisms to use, defaults to None
:param source: string specifying which attribute of the presynaptic cell signals action potentials. This is only needed for multicompartmental cells with branching axons or dendrodendritic synapses. All standard cells have a single source, and this is the default, defaults to None
:param receptor_type: string specifying which synaptic receptor_type type on the postsynaptic cell to connect to. For standard cells, this can be ‘excitatory’ or ‘inhibitory’. For non-standard cells, it could be ‘NMDA’, etc. If receptor_type is not given, the default values of ‘excitatory’ is used, defaults to None
:param space: Space object, determining how distances should be calculated for distance-dependent wiring schemes or parameter values, defaults to Space()
:param label: a name for the projection (one will be auto-generated if this is not supplied), defaults to None
-
__getitem__
(self, i) Return the *i*th connection within the Projection.
-
__len__
(self) Return the total number of local connections.
-
__setattr__
(self, name, value)
-
get_data
(self, str observable) Get data for an observable per synapse.
:param observable: Name of observable. :return: Array with recorded data. The array’s entries are values for each timer entry. Each value has a
.data
attribute, containing the recorded data.:raises RuntimeError: If observable name is not known or the projection does not implement a plasticity rule.
-
placed_connections
(self) Query the last routing run for placement of this projection.
Public Static Functions
-
add_to_network_graph
(List[Population] populations, Projection projection, grenade.NetworkBuilder builder)
Protected Functions
-
_convergent_connect
(self, presynaptic_indices, postsynaptic_index, location_selector=None, **connection_parameters) Connect a neuron to one or more other neurons with a static connection.
-
_set_attributes
(self, parameter_space)
-
_set_initial_value_array
(self, variable, initial_value)
Protected Static Functions
-
_get_comp_id_from_location
(str location, celltype)
-
-
pynn_brainscales.brainscales2.recording.Recorder : public pyNN.recording.Recorder
Public Functions
-
__init__
(self, population, file=None)
-
filter_recorded
(self, variable, filter_ids)
-
get
(self, variables, gather=False, filter_ids=None, clear=False, annotations=None, locations=None) Return the recorded data as a Neo
Block
.
-
record
(self, variables, ids, sampling_interval=None, locations=None, *device="madc")
Public Members
-
changed_since_last_run
Protected Functions
-
_clear_simulator
(self)
-
_get_all_signals
(self, variable, ids, i, clear=False)
-
_get_current_segment
(self, filter_ids=None, variables='all', clear=False)
-
_get_location_label
(self, halco.CompartmentOnLogicalNeuron comp_id)
-
_get_recording_sites
(self, List[int] neuron_ids, Optional[Sequence[str]] locations=None)
-
_get_spiketimes
(self, ids, i, clear=False) Returns a dict containing the recording site and its spiketimes.
-
_local_count
(self, variable, filter_ids)
-
_rec_site_to_grenade_index
(self, RecordingSite rec_site)
-
_record
(self, variable, new_ids, sampling_interval=None)
-
_reset
(self)
Protected Static Functions
-
_device_name_to_pad_config
(str device) Extract pad and buffering mode from device name.
The device name is of the form ‘pad_[0|1][|_unbuffered|_buffered]’. Raise ValueError if device name does not fit format. Otherwise, extract pad as well as buffering mode from device name. :param device: Device to record. :returns: Pad, buffering enabled.
Protected Static Attributes
-
_simulator
= simulator
-
-
pynn_brainscales.brainscales2.recording_data.GrenadeRecId : public NamedTuple
-
pynn_brainscales.brainscales2.recording_data.MADCData : public NamedTuple
Times and values of a MADC recording.
-
pynn_brainscales.brainscales2.recording_data.PadConfig : public NamedTuple
-
class
pynn_brainscales.brainscales2.recording_data.
Recording
Save recording information as well as recorded data.
-
class
pynn_brainscales.brainscales2.recording_data.
RecordingConfig
Save which observables are recorded with which “device”.
Currently we only support MADC recordings but in future we want to support readout via the pads and via the CADC. This class saves which observables are recorded for which recording site (recording site = neuron + compartment) and which device is used, where a device is the method of readout, i.e. MADC.
Public Functions
-
__init__
(self)
-
add_madc_recording
(self, Set[str] variables, Set[GrenadeRecId] recording_sites)
-
add_pad_readout
(self, Set[str] variables, Set[GrenadeRecId] recording_sites, int pad, bool buffered=True)
-
add_to_network_graph
(self, grenade.network.NetworkBuilder network_builder)
-
remove
(self, GrenadeRecId recording_site)
Public Static Attributes
-
analog_observable_names
= list(str_to_source_map)
-
str_to_source_map
= \{"v": hal.NeuronConfig.ReadoutSource.membrane,"exc_synin": hal.NeuronConfig.ReadoutSource.exc_synin,"inh_synin": hal.NeuronConfig.ReadoutSource.inh_synin,"adaptation": hal.NeuronConfig.ReadoutSource.adaptation}
-
-
class
pynn_brainscales.brainscales2.recording_data.
RecordingData
Save recorded data.
Currently we only support MADC recordings but in future we want to support readout via the pads and via the CADC. This class saves data which was recorded during an experiment run.
-
pynn_brainscales.brainscales2.recording_data.RecordingSite : public NamedTuple
-
pynn_brainscales.brainscales2.recording_data.RecordingType : public Enum
-
pynn_brainscales.brainscales2.RunCommand : public Enum
Command specifying the type of run to be performed in pynn.run()
:param prepare: Command that only induces all preparatory steps for the hardware backend, e.g. place&route of network graph or execution of calibration. :param append: Command that induces the scheduling of an experiment snippet for the system in the currently defined state for a certain runtime. :param execute: Command that induces a hardware run. Executes the already scheduled experiment and optionally append one last experiment snippet.
-
class
pynn_brainscales.brainscales2.simulator.
BackgroundSpikeSourcePlacement
Tracks assignment of pyNN IDs of SpikeSourcePoissonOnChip based populations to the corresponding hardware entity, i.e.
BackgroundSpikeSourceOnDLS. We use one source on each hemisphere to ensure arbitrary routing works. Default constructed with reversed 1 to 1 permutation to yield better distribution for small networks.
:cvar DEFAULT_PERMUTATION: Default permutation, where allocation is ordered to start at the highest-enum PADI-bus to reduce overlap with allocated neurons.
Public Functions
-
__init__
(self, List[int] permutation=None) :param permutation: Look up table for permutation.
Index: HW related population neuron enumeration. Value: HW neuron enumeration.
-
id2source
(self, Union[List[ID], ID] neuron_id) Get hardware coordinate from pyNN ID.
:param neuron_id: pyNN neuron ID
-
register_id
(self, Union[List[ID], ID] neuron_id) Register a new ID to placement.
:param neuron_id: pyNN neuron ID to be registered
Public Static Attributes
-
DEFAULT_PERMUTATION
= list(reversed(range(halco.PADIBusOnPADIBusBlock.size)))
Protected Static Functions
-
_check_and_transform
(list lut)
-
-
pynn_brainscales.brainscales2.simulator.ID : public int , public IDMixin
Public Functions
-
__init__
(self, n) Create an ID object with numerical value
n
.
Private Static Attributes
-
__doc__
= IDMixin.__doc__
-
-
pynn_brainscales.brainscales2.simulator.MADCRecording : public NamedTuple
Times and values of a MADC recording.
-
class
pynn_brainscales.brainscales2.simulator.
NeuronPlacement
Tracks the assignment of pyNN IDs to LogicalNeuronOnDLS.
This tracking is needed for all neuron types which are placed in the neuron array. By default the anchor of the neurons are placed in increasing order of the hardware enumeration.
:param neuron_id: Look up table for permutation. Index: HW related population neuron enumeration. Value: HW neuron enumeration.
Public Functions
-
__init__
(self, List[int] permutation=None)
-
id2first_circuit
(self, Union[List[ID], ID] neuron_id) Get hardware coordinate of first circuit in first compartment as plain int from pyNN ID.
:param neuron_id: pyNN neuron ID :return: Enums of first circuits in first compartments.
-
id2logicalneuron
(self, Union[List[ID], ID] neuron_id) Get hardware coordinate from pyNN ID :param neuron_id: pyNN neuron ID.
-
register_neuron
(self, Union[List[ID], ID] neuron_id, halco.LogicalNeuronCompartments logical_compartments) Register new IDs to placement.
:param neuron_id: pyNN neuron IDs to be registered. :param logical_compartments: LogicalNeuronCompartments which belong to the neurons which should be registered. All neurons which should be registered have to share the same morphology, i.e. have the same LogicalNeuronCompartments coordinate.
Public Static Attributes
-
DEFAULT_PERMUTATION
= range(halco.AtomicNeuronOnDLS.size)
Protected Static Functions
-
_check_and_transform
(list lut)
-
-
pynn_brainscales.brainscales2.simulator.State : public BaseState
Represent the simulator state.
Public Functions
-
__init__
(self)
-
add
(self, float runtime) Adds currently specified configuration, network_graph and inputs to list, which is processed serially in run()
-
clear
(self)
-
prepare_static_config
(self)
-
preprocess
(self) 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. CalibHXNeuronCuba/Coba and make adjustments if needed. If not called manually is automatically called on run().
-
reset
(self) Reset the state of the current network to time t = 0.
-
run
(self) Performs a hardware run of the currently scheduled experiment.
-
run_until
(self, tstop)
Public Members
-
array_observables
-
background_spike_source_placement
-
calib_cache_dir
-
configs
-
conn
-
conn_comes_from_outside
-
conn_manager
-
current_sources
-
execution_time_info
-
grenade_chip_config
-
grenade_network
-
grenade_network_graph
-
id_counter
-
initial_config
-
injected_calib_options
-
injected_calib_target
-
injected_config
-
injected_readout
-
injection_inside_realtime
-
injection_inside_realtime_begin
-
injection_inside_realtime_end
-
injection_post_realtime
-
injection_pre_realtime
-
injection_pre_static_config
-
inputs
-
inside_realtime_begin_read
-
inside_realtime_begin_tickets
-
inside_realtime_end_read
-
inside_realtime_end_tickets
-
log
-
max_delay
-
min_delay
-
mpi_rank
-
network_graphs
-
neuron_placement
-
neuronal_observables
-
num_processes
-
plasticity_rules
-
populations
-
post_realtime_read
-
post_realtime_tickets
-
ppu_symbols_read
-
pre_realtime_read
-
pre_realtime_tickets
-
projections
-
realtime_snippet_count
-
record_sample_times
-
recorders
-
recordings
-
running
-
runtimes
-
segment_counter
-
synaptic_observables
-
t
-
t_start
Protected Functions
-
_configure_recorders_populations
(self)
-
_generate_hooks
(self)
-
_generate_inputs
(self, grenade.network.NetworkGraph network_graph) Generate external input events from the routed network graph representation.
-
_generate_network_graph
(self) Generate placed and routed executable network graph representation.
-
_get_array_observables
(self, grenade.network.NetworkGraph network_graph, grenade.signal_flow.OutputData outputs) Get general array observables.
:param network_graph: Network graph to use for lookup of plasticity rule descriptor :param outputs: All outputs of a single execution to extract samples from :return: List of dicts over plasticity rules and recorded data, one dict per plasticity rule
-
_get_neuronal_observables
(self, grenade.network.NetworkGraph network_graph, grenade.signal_flow.OutputData outputs) Get neuronal observables.
:param network_graph: Network graph to use for lookup of plasticity rule descriptor :param outputs: All outputs of a single execution to extract samples from :return: Dict over projections and recorded data
-
_get_post_realtime_read
(self) Redeem tickets of injected readout after post_realtime section to get information after execution.
:return: Dictionary with coordinates as keys and read container as values.
-
_get_pre_realtime_read
(self) Redeem tickets of injected readout after pre_realtime section to get information after execution.
:return: Dictionary with coordinates as keys and read container as values.
-
_get_synaptic_observables
(self, grenade.network.NetworkGraph network_graph, grenade.signal_flow.OutputData outputs) Get synaptic observables.
:param network_graph: Network graph to use for lookup of plasticity rule descriptor. :param outputs: All outputs of a single execution to extract samples from. :return: List over projections and recorded data.
-
_get_v
(self, grenade.network.NetworkGraph network_graph, grenade.signal_flow.OutputData outputs, Recording # Note:Any should be recording.MADCRecordingSite. We do not # annotate the correct type due to cyclic imports. recording) Get MADC samples with times in ms.
:param network_graph: Network graph to use for lookup of MADC output vertex descriptor :param outputs: All outputs of a single execution to extract samples from :return: Dictionary with a madc recording site as key and a MADCRecording as value.
-
_prepare_inside_realtime_begin_read
(self, sta.PlaybackProgramBuilder builder) Prepare injected readout after inside_realtime_begin configuration and before event insertion.
This generates tickets to access the read information and ensures completion via a barrier. :param builder: Builder to append instructions to.
-
_prepare_inside_realtime_end_read
(self, sta.PlaybackProgramBuilder builder) Prepare injected readout after inside_realtime_end configuration and after realtime_end experiment section.
This generates tickets to access the read information and ensures completion via a barrier. :param builder: Builder to append instructions to.
-
_prepare_post_realtime_read
(self, sta.PlaybackProgramBuilder builder) Prepare injected readout after post_realtime configuration.
This generates tickets to access the read information and ensures completion via a barrier. :param builder: Builder to append instructions to.
-
_prepare_pre_realtime_read
(self, sta.PlaybackProgramBuilder builder) Prepare injected readout after pre_realtime configuration and before realtime experiment section.
This generates tickets to access the read information and ensures completion via a barrier. :param builder: Builder to append instructions to.
-
_reset_changed_since_last_run
(self) Reset changed_since_last_run flag to track incremental changes for the next run.
-
-
pynn_brainscales.brainscales2.standardmodels.cells.CalibHXNeuronCoba : public pynn_brainscales.brainscales2.standardmodels.cells.CalibHXNeuronCuba
HX Neuron with automated calibration.
Cell parameters correspond to parameters for Calix spiking calibration.
Uses conductance-based synapses.
Public Functions
-
__init__
(self, Optional[plasticity_rules.PlasticityRule] plasticity_rule=None, *Optional[Union[int, List, np.ndarray]] v_rest=None, Optional[Union[int, List, np.ndarray]] v_reset=None, Optional[Union[int, List, np.ndarray]] v_thresh=None, Optional[Union[int, List, np.ndarray]] tau_m=None, Optional[Union[int, List, np.ndarray]] tau_syn_E=None, Optional[Union[int, List, np.ndarray]] tau_syn_I=None, Optional[Union[int, List, np.ndarray]] cm=None, Optional[Union[int, List, np.ndarray]] tau_refrac=None, Optional[Union[int, List, np.ndarray]] i_synin_gm_E=None, Optional[Union[int, List, np.ndarray]] i_synin_gm_I=None, Optional[Union[int, List, np.ndarray]] e_rev_E=None, Optional[Union[int, List, np.ndarray]] e_rev_I=None, Optional[Union[int, List, np.ndarray]] synapse_dac_bias=None, **parameters) Set initial neuron parameters.
All parameters except for the plasticity rule have to be either 1-dimensional or population-size dimensional.
Additional key-word arguments are also saved in the parameter space of the neuron but do not influence the calibration.
:param plasticity_rule: Plasticity rule which is evaluated periodically during the experiment to change the parameters of the neuron. :param v_rest: Resting potential. Value range [50, 160]. :param v_reset: Reset potential. Value range [50, 160]. :param v_thresh: Threshold potential. Value range [50, 220]. :param tau_m: Membrane time constant. Value range [0.5, 60]us. :param tau_syn_E: Excitatory synaptic input time constant. Value range [0.3, 30]us. :param tau_syn_I: Inhibitory synaptic input time constant. Value range [0.3, 30]us. :param cm: Membrane capacitance. Value range [0, 63]. :param tau_refrac: Refractory time. Value range [.04, 32]us. :param i_synin_gm_E: Excitatory synaptic input strength bias current. Scales the strength of excitatory weights. Technical parameter which needs to be same for all populations. Value range [30, 800]. :param i_synin_gm_I: Inhibitory synaptic input strength bias current. Scales the strength of excitatory weights. Technical parameter which needs to be same for all populations. Value range [30, 800]. :param e_rev_E: Excitatory COBA synaptic input reversal potential. At this potential, the synaptic input strength will be zero. Value range [60, 160]. :param e_rev_I: Inhibitory COBA synaptic input reversal potential. At this potential, the synaptic input strength will be zero. Value range [60, 160]. :param synapse_dac_bias: Synapse DAC bias current. Technical parameter which needs to be same for all populations Can be lowered in order to reduce the amplitude of a spike at the input of the synaptic input OTA. This can be useful to avoid saturation when using larger synaptic time constants. Value range [30, 1022].
-
add_calib_params
(self, Dict calib_params, List cell_ids)
Public Static Attributes
-
conductance_based
= True
-
default_parameters
= {'v_rest': 110.,'v_reset': 100.,'v_thresh': 160.,'tau_m': 10.,'tau_syn_E': 10.,'tau_syn_I': 10.,'cm': 63,'tau_refrac': 2.,'e_rev_E': 300.,'e_rev_I': 30.,'i_synin_gm_E': 180,'i_synin_gm_I': 250,'synapse_dac_bias': 400,**NeuronCellType.default_parameters}
-
param_trans
= {'v_rest': 'leak','v_reset': 'reset','v_thresh': 'threshold','tau_m': 'tau_mem','tau_syn_E': 'tau_syn','tau_syn_I': 'tau_syn','cm': 'membrane_capacitance','tau_refrac': 'refractory_time','e_rev_E': 'e_coba_reversal','e_rev_I': 'e_coba_reversal','i_synin_gm_E': 'i_synin_gm','i_synin_gm_I': 'i_synin_gm','synapse_dac_bias': 'synapse_dac_bias','v': 'v','exc_synin': 'exc_synin','inh_synin': 'inh_synin','adaptation': 'adaptation',**{key: translation["translated_name"]for key, translation in NeuronCellType.translations.items()}}
-
translations
= {**build_translations(('v_rest', 'v_rest'),('v_reset', 'v_reset'),('v_thresh', 'v_thresh'),('tau_m', 'tau_m'),('tau_syn_E', 'tau_syn_E'),('tau_syn_I', 'tau_syn_I'),('cm', 'cm'),('tau_refrac', 'tau_refrac'),('e_rev_E', 'e_rev_E'),('e_rev_I', 'e_rev_I'),('i_synin_gm_E', 'i_synin_gm_E'),('i_synin_gm_I', 'i_synin_gm_I'),('synapse_dac_bias', 'synapse_dac_bias'),('v', 'v'),('exc_synin', 'exc_synin'),('inh_synin', 'inh_synin'),('adaptation', 'adaptation')),**NeuronCellType.translations}
-
units
= {'v_rest': 'dimensionless','v_reset': 'dimensionless','v_thresh': 'dimensionless','tau_m': 'us','tau_syn_E': 'us','tau_syn_I': 'us','cm': 'dimensionless','refractory_time': 'us','e_rev_E': 'dimensionless','e_rev_I': 'dimensionless','i_synin_gm_E': 'dimensionless','i_synin_gm_I': 'dimensionless','synapse_dac_bias': 'dimensionless',"v": "dimensionless","exc_synin": "dimensionless","inh_synin": "dimensionless","adaptation": "dimensionless",**NeuronCellType.units}
Protected Attributes
-
_calib_target
-
-
pynn_brainscales.brainscales2.standardmodels.cells.CalibHXNeuronCuba : public pynn_brainscales.brainscales2.standardmodels.cells_base.NeuronCellType
HX Neuron with automated calibration.
Cell parameters correspond to parameters for Calix spiking calibration.
Uses current-based synapses.
Subclassed by pynn_brainscales.brainscales2.standardmodels.cells.CalibHXNeuronCoba
Public Functions
-
__init__
(self, Optional[plasticity_rules.PlasticityRule] plasticity_rule=None, *Optional[Union[int, List, np.ndarray]] v_rest=None, Optional[Union[int, List, np.ndarray]] v_reset=None, Optional[Union[int, List, np.ndarray]] v_thresh=None, Optional[Union[int, List, np.ndarray]] tau_m=None, Optional[Union[int, List, np.ndarray]] tau_syn_E=None, Optional[Union[int, List, np.ndarray]] tau_syn_I=None, Optional[Union[int, List, np.ndarray]] cm=None, Optional[Union[int, List, np.ndarray]] tau_refrac=None, Optional[Union[int, List, np.ndarray]] i_synin_gm_E=None, Optional[Union[int, List, np.ndarray]] i_synin_gm_I=None, Optional[Union[int, List, np.ndarray]] synapse_dac_bias=None, **parameters) Set initial neuron parameters.
All parameters except for the plasticity rule have to be either 1-dimensional or population-size dimensional.
Additional keyword arguments are also saved in the parameter space of the neuron but do not influence the calibration.
:param plasticity_rule: Plasticity rule which is evaluated periodically during the experiment to change the parameters of the neuron. :param v_rest: Resting potential. Value range [50, 160]. :param v_reset: Reset potential. Value range [50, 160]. :param v_thresh: Threshold potential. Value range [50, 220]. :param tau_m: Membrane time constant. Value range [0.5, 60]us. :param tau_syn_E: Excitatory synaptic input time constant. Value range [0.3, 30]us. :param tau_syn_I: Inhibitory synaptic input time constant. Value range [0.3, 30]us. :param cm: Membrane capacitance. Value range [0, 63]. :param tau_refrac: Refractory time. Value range [.04, 32]us. :param i_synin_gm_E: Excitatory synaptic input strength bias current. Scales the strength of excitatory weights. Technical parameter which needs to be same for all populations. Value range [30, 800]. :param i_synin_gm_I: Inhibitory synaptic input strength bias current. Scales the strength of excitatory weights. Technical parameter which needs to be same for all populations. Value range [30, 800]. :param synapse_dac_bias: Synapse DAC bias current. Technical parameter which needs to be same for all populations Can be lowered in order to reduce the amplitude of a spike at the input of the synaptic input OTA. This can be useful to avoid saturation when using larger synaptic time constants. Value range [30, 1022].
-
actual_hwparams
(self) Hardware parameters used for actual hardware execution, can be manually adjusted.
Only set after pynn.preprocess() or pynn.run() call.
-
add_calib_params
(self, Dict calib_params, List cell_ids)
-
add_to_chip
(self, List cell_ids, lola.Chip config) Add configuration of each neuron in the parameter space to the given chip object.
:param cell_ids: Cell IDs for each neuron in the parameter space of this celltype object. :param chip: Lola chip object which is altered.
-
calib_hwparams
(self) Archive of resulting hardware parameters from last calibration run.
Only set after pynn.preprocess() or pynn.run() call.
-
calib_target
(self) Archive of cell parameters used for last calibration run.
Only set after pynn.preprocess() or pynn.run() call.
-
can_record
(self, str variable, location=None)
Public Static Functions
-
add_to_input_generator
(Population population, grenade.InputGenerator builder) Add external events to input generator.
:param population: Population to add featuring this cell’s celltype. :param builder: Input builder to add external events to.
-
add_to_network_graph
(Population population, grenade.NetworkBuilder builder) Add population to network builder.
:param population: Population to add featuring this cell’s celltype. :param builder: Network builder to add population to. :return: Descriptor of added population
Public Static Attributes
-
conductance_based
= False
-
default_parameters
= {'v_rest': 80.,'v_reset': 70.,'v_thresh': 125.,'tau_m': 10.,'tau_syn_E': 10.,'tau_syn_I': 10.,'cm': 63,'tau_refrac': 2.,'i_synin_gm_E': 500,'i_synin_gm_I': 500,'synapse_dac_bias': 600,**NeuronCellType.default_parameters}
-
logical_compartments
= \halco.LogicalNeuronCompartments({halco.CompartmentOnLogicalNeuron():[halco.AtomicNeuronOnLogicalNeuron()]})
-
param_trans
= {'v_rest': 'leak','v_reset': 'reset','v_thresh': 'threshold','tau_m': 'tau_mem','tau_syn_E': 'tau_syn','tau_syn_I': 'tau_syn','cm': 'membrane_capacitance','tau_refrac': 'refractory_time','i_synin_gm_E': 'i_synin_gm','i_synin_gm_I': 'i_synin_gm','synapse_dac_bias': 'synapse_dac_bias','v': 'v','exc_synin': 'exc_synin','inh_synin': 'inh_synin','adaptation': 'adaptation',**{key: translation["translated_name"]for key, translation in NeuronCellType.translations.items()}}
-
receptor_types
= ["excitatory", "inhibitory"]
-
recordable
= ["spikes", "v", "exc_synin", "inh_synin","adaptation"]
-
translations
= {**build_translations(('v_rest', 'v_rest'),('v_reset', 'v_reset'),('v_thresh', 'v_thresh'),('tau_m', 'tau_m'),('tau_syn_E', 'tau_syn_E'),('tau_syn_I', 'tau_syn_I'),('cm', 'cm'),('tau_refrac', 'tau_refrac'),('i_synin_gm_E', 'i_synin_gm_E'),('i_synin_gm_I', 'i_synin_gm_I'),('synapse_dac_bias', 'synapse_dac_bias'),('v', 'v'),('exc_synin', 'exc_synin'),('inh_synin', 'inh_synin'),('adaptation', 'adaptation')),**NeuronCellType.translations}
-
units
= {'v_rest': 'dimensionless','v_reset': 'dimensionless','v_thresh': 'dimensionless','tau_m': 'us','tau_syn_E': 'us','tau_syn_I': 'us','cm': 'dimensionless','tau_refrac': 'us','i_synin_gm_E': 'dimensionless','i_synin_gm_I': 'dimensionless','synapse_dac_bias': 'dimensionless',"v": "dimensionless","exc_synin": "dimensionless","inh_synin": "dimensionless","adaptation": "dimensionless",**NeuronCellType.units}
-
-
pynn_brainscales.brainscales2.standardmodels.cells.HXNeuron : public pynn_brainscales.brainscales2.standardmodels.cells_base.NeuronCellType
One to one representation of subset of parameter space of a lola.AtomicNeuron.
Parameter hierarchy is flattened. Defaults to “silent” neuron.
:param parameters: Mapping of parameters and corresponding values, e.g. dict. Either 1-dimensional or population size dimensions. Default values are overwritten for specified parameters.
Public Functions
-
__init__
(self, **parameters) parameters
should be a mapping object, e.g.a dict
-
add_to_chip
(self, List cell_ids, lola.Chip config) Add configuration of each neuron in the parameter space to the give chip object.
:param cell_ids: Cell IDs for each neuron in the parameter space of this celltype object. :param chip: Lola chip object which is altered.
-
apply_config
(self, List[halco.LogicalNeuronOnDLS] logical_coords) Extract and apply config according to provided chip object.
:param coords: List of coordinates to look up coco. Needs same order and dimensions as parameter_space.
-
can_record
(self, str variable, location=None)
-
create_hw_entity
(cls, dict pynn_parameters) Builds a Lola Neuron with the values from the dict ‘pynn_parameters’.
-
get_default_values
(cls) Get the default values.
Public Static Functions
-
add_to_input_generator
(Population population, grenade.InputGenerator builder) Add external events to input generator.
:param population: Population to add featuring this cell’s celltype. :param builder: Input builder to add external events to.
-
add_to_network_graph
(Population population, grenade.NetworkBuilder builder) Add population to network builder.
:param population: Population to add featuring this cell’s celltype. :param builder: Network builder to add population to. :return: Descriptor of added population
Public Static Attributes
-
conductance_based
= False
-
default_parameters
-
injectable
= True
-
logical_compartments
= \halco.LogicalNeuronCompartments({halco.CompartmentOnLogicalNeuron():[halco.AtomicNeuronOnLogicalNeuron()]})
-
receptor_types
= ["excitatory", "inhibitory"]
-
recordable
= ["spikes", "v", "exc_synin", "inh_synin","adaptation"]
-
translations
-
units
= {"v": "dimensionless","exc_synin": "dimensionless","inh_synin": "dimensionless","adaptation": "dimensionless",**NeuronCellType.units}
Protected Functions
-
_create_translation
(cls)
-
_generate_hw_entity_setters
(cls) Builds setters for creation of Lola Neuron.
Protected Static Attributes
-
_hw_entity_setters
= [Dict[str, Callable]]
-
_NOT_CONFIGURABLE
= ["event_routing_analog_output","event_routing_enable_digital","leak_reset_i_bias_source_follower","readout_enable_amplifier","readout_source","readout_enable_buffered_access","readout_i_bias"]
-
_user_provided_parameters
= [Dict[str, Union[int, bool]]]
-
-
pynn_brainscales.brainscales2.standardmodels.cells.SpikeSourceArray : public pynn_brainscales.brainscales2.standardmodels.cells_base.StandardCellType
Spike source generating spikes at the times [ms] given in the spike_times array.
Public Functions
-
can_record
(self, str variable, location=None)
Public Static Functions
-
add_to_input_generator
(Population population, grenade.InputGenerator builder) Add external events to input generator.
:param population: Population to add featuring this cell’s celltype. :param builder: Input builder to add external events to.
-
add_to_network_graph
(Population population, grenade.NetworkBuilder builder) Add population to network builder.
:param population: Population to add featuring this cell’s celltype. :param builder: Network builder to add population to. :return: Descriptor of added population
-
-
pynn_brainscales.brainscales2.standardmodels.cells.SpikeSourcePoisson : public pynn_brainscales.brainscales2.standardmodels.cells_base.StandardCellType
Spike source, generating spikes according to a Poisson process.
Public Functions
-
__init__
(self, start, rate, duration)
-
can_record
(self, str variable, location=None)
-
get_spike_times
(self) When this function is called for the first time, the spike times for a Poisson stimulation are calculated and saved, so that all neurons connected to it receive the same stimulation.
When a parameter was changed (compared to the last calculation of the spike time), the times are recalculated.
:return: (unsorted) spike times for each neuron in the population.
Public Static Functions
-
add_to_input_generator
(Population population, grenade.InputGenerator builder) Add external events to input generator.
:param population: Population to add featuring this cell’s celltype. :param builder: Input builder to add external events to.
-
add_to_network_graph
(Population population, grenade.NetworkBuilder builder) Add population to network builder.
:param population: Population to add featuring this cell’s celltype. :param builder: Network builder to add population to. :return: Descriptor of added population
-
-
pynn_brainscales.brainscales2.standardmodels.cells.SpikeSourcePoissonOnChip : public pynn_brainscales.brainscales2.standardmodels.cells_base.StandardCellType
Spike source, generating spikes according to a Poisson process.
Public Static Functions
-
add_to_input_generator
(Population population, grenade.InputGenerator builder) Add external events to input generator.
:param population: Population to add featuring this cell’s celltype. :param builder: Input builder to add external events to.
-
add_to_network_graph
(Population population, grenade.NetworkBuilder builder) Add population to network builder.
:param population: Population to add featuring this cell’s celltype. :param builder: Network builder to add population to. :return: Descriptor of added population
-
-
pynn_brainscales.brainscales2.standardmodels.cells_base.NeuronCellType : public pynn_brainscales.brainscales2.standardmodels.cells_base.StandardCellType , public pynn_brainscales.brainscales2.plasticity_rules.PlasticityRuleHandle
Network addable cell with plasticity rule handle.
Currently this includes setting the readout source of each neuron to be available to the plasticity rule.
Subclassed by pynn_brainscales.brainscales2.standardmodels.cells.CalibHXNeuronCuba, pynn_brainscales.brainscales2.standardmodels.cells.HXNeuron
Public Functions
-
__init__
(self, Optional[plasticity_rules.PlasticityRule] plasticity_rule=None, **parameters) Create a new handle to a plasticity rule.
:param plasticity_rule: PlasticityRule instance. :param observable_options: Observable options to use in this cell type instance.
-
to_plasticity_rule_population_handle
(cls, Population population) Convert observable options to population handle of plasticity rule to backend representation, when plasticity rule handle is assoiated to neuron cell type and used in a population.
:param population: Population for which to convert :return: Representation in grenade
Public Static Attributes
-
default_parameters
= {"plasticity_rule_readout_source":float(lola.AtomicNeuron.Readout.Source.membrane),"plasticity_rule_enable_readout_source": False}
-
ReadoutSource
= lola.AtomicNeuron.Readout.Source
-
translations
= build_translations(("plasticity_rule_readout_source","plasticity_rule_readout_source"),("plasticity_rule_enable_readout_source","plasticity_rule_enable_readout_source"),)
-
units
= {"plasticity_rule_readout_source": "dimensionless","plasticity_rule_enable_readout_source": "dimensionless"}
-
-
pynn_brainscales.brainscales2.standardmodels.cells_base.StandardCellType : public ABC , public UpstreamStandardCellType
Network addable standard cell type, to be used as base for all cells.
Subclassed by pynn_brainscales.brainscales2.morphology.mc_neuron_base.McNeuronBase, pynn_brainscales.brainscales2.standardmodels.cells.SpikeSourceArray, pynn_brainscales.brainscales2.standardmodels.cells.SpikeSourcePoisson, pynn_brainscales.brainscales2.standardmodels.cells.SpikeSourcePoissonOnChip, pynn_brainscales.brainscales2.standardmodels.cells_base.NeuronCellType
Public Functions
-
__init__
(self, **parameters)
Public Static Functions
-
add_to_input_generator
(Population population, grenade.InputGenerator builder) Add external events to input generator.
:param population: Population to add featuring this cell’s celltype. :param builder: Input builder to add external events to.
-
add_to_network_graph
(Population population, grenade.NetworkBuilder builder) Add population to network builder.
:param population: Population to add featuring this cell’s celltype. :param builder: Network builder to add population to. :return: Descriptor of added population
-
-
pynn_brainscales.brainscales2.standardmodels.synapses.PlasticSynapse : public pynn_brainscales.brainscales2.standardmodels.synapses.StaticSynapse , public pynn_brainscales.brainscales2.plasticity_rules.PlasticityRuleHandle
Synaptic connection with fixed initial weight and delay and handle to plasticity rule.
Public Functions
-
__init__
(self, int weight=0, float delay=0, plasticity_rules.PlasticityRule plasticity_rule=None) Create a new handle to a plasticity rule.
:param plasticity_rule: PlasticityRule instance. :param observable_options: Observable options to use in this cell type instance.
Public Static Attributes
-
translations
= build_translations(('weight', 'weight'),('delay', 'delay'))
-
-
pynn_brainscales.brainscales2.standardmodels.synapses.StaticRecordingSynapse : public pynn_brainscales.brainscales2.standardmodels.synapses.StaticSynapse , public pynn_brainscales.brainscales2.plasticity_rules.PlasticityRuleHandle
Synaptic connection with fixed weight and delay.
Public Functions
-
__init__
(self, plasticity_rules.Timer timer, float weight, Set[str] observables) Create a new handle to a plasticity rule.
:param plasticity_rule: PlasticityRule instance. :param observable_options: Observable options to use in this cell type instance.
Public Members
-
changed_since_last_run
Properties
-
observables
= property(_get_observables, _set_observables)
-
plasticity_rule
= property(_get_plasticity_rule, _set_plasticity_rule)
Protected Functions
-
_get_observables
(self)
-
_get_plasticity_rule
(self)
-
_set_observables
(self, Set[str] value)
-
_set_plasticity_rule
(self, new_plasticity_rule)
Protected Attributes
-
_observables
-
-
pynn_brainscales.brainscales2.standardmodels.synapses.StaticRecordingSynapse.RecordingRule : public pynn_brainscales.brainscales2.plasticity_rules.PlasticityRule
“Plasticity” rule only usable for generating recording of observables.
Reference to set of observables is stored and used.
Public Functions
-
__init__
(self, plasticity_rules.Timer timer, Set[str] observables) Create a new plasticity rule with timing information.
:param timer: Timer object.
-
add_to_network_graph
(self, grenade.NetworkBuilder builder)
Properties
-
observables
= property(_get_observables, _set_observables)
Protected Attributes
-
_recording_observables
-
-
class
pynn_brainscales.brainscales2.standardmodels.synapses.
StaticSynapse
Synaptic connection with fixed weight and delay.
Subclassed by pynn_brainscales.brainscales2.standardmodels.synapses.PlasticSynapse, pynn_brainscales.brainscales2.standardmodels.synapses.StaticRecordingSynapse
Public Static Attributes
-
translations
= build_translations(('weight', 'weight'),('delay', 'delay'))
Protected Functions
-
_get_minimum_delay
(self)
-
-
namespace
pynn
-
namespace
pyNN
-
namespace
common
-
namespace
connectors
-
namespace
recording
-
module
pynn_brainscales
-
module
pynn_brainscales.
brainscales2
Implementation of the PyNN API for the neuromorphic BrainScales2 system.
Functions
-
end
() Do any necessary cleaning up before exiting.
-
get_backend_statistics
() 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. :return: Statistics object.
-
get_execution_time_info
() 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. :return: Time info object.
-
get_post_realtime_read
() Get injected read results of after post_realtime section.
:return: Dictionary with coordinates as keys and read container as values.
-
get_post_realtime_read_ppu_symbols
() 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.
-
get_pre_realtime_read
() Get injected read results of after pre_realtime section.
:return: Dictionary with coordinates as keys and read container as values.
-
list_standard_models
() Return a list of all the StandardCellType classes available for this simulator.
-
preprocess
() Does the same as pyNN.run(pyNN.RunCommand.PREPARE).
Exists only due to backwards-compatibility reasons.
-
run
(Optional[float] runtime, RunCommand command=RunCommand.EXECUTE) 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.
-
setup
(timestep=simulator.State.dt, min_delay=DEFAULT_MIN_DELAY, **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.
Variables
-
_
-
__all__
= ["list_standard_models", "setup", "end", "run", "run_until","run_for", "reset", "initialize", "get_current_time", "create","connect", "set", "record", "logger", "preprocess"]
-
connect
= common.build_connect(Projection, FixedProbabilityConnector,synapses.StaticSynapse)
-
create
= common.build_create(Population)
-
initialize
= common.initialize
-
num_processes
-
rank
-
record
= common.build_record(simulator)
-
reset
= common.build_reset(simulator)
-
run_for
= run
-
run_until
-
set
= common.set
-
-
module
connectors
Add
location_selector
andsource_location_selector
to build-in pyNN connectors.This allows connections between neurons with several locations.
-
module
examples
-
module
pynn_brainscales.brainscales2.examples.
crossbar_event_counter_read
Functions
-
main
(int num_spikes=200, float runtime=20.) This example shows readout of the event output counters in the routing crossbar via injected reads.
:param num_spikes: Number of spikes to inject during the experiment. :param runtime: Runtime of the experiment [ms]. :return: Difference between counter values before the experiment and after the experiment. The results are saved in a dictionary with an entry for each crossbar output.
-
-
module
pynn_brainscales.brainscales2.examples.
external_input
Functions
-
main
(dict params)
Variables
-
cell_params
= {"threshold_v_threshold": 300,"leak_v_leak": 750,"leak_i_bias": 420,"leak_enable_division": True,"reset_v_reset": 200,"reset_i_bias": 950,"reset_enable_multiplication": True,"threshold_enable": True,"membrane_capacitance_capacitance": 4,"refractory_period_refractory_time": 250,"excitatory_input_enable": True,"excitatory_input_i_bias_tau": 150,"excitatory_input_i_bias_gm": 200,# FIXME: replace by i_drop_input and i_shift_reference# "excitatory_input_v_syn": 700}
-
level
-
log
= pynn.logger.get("external_input")
-
spiketimes
= main(cell_params)
-
-
module
pynn_brainscales.brainscales2.examples.
isi_calib
-
module
pynn_brainscales.brainscales2.examples.
multicompartment
Functions
-
main
() Create a chain of compartments with three compartments.
Record the membrane voltage in the first compartment while synaptic inputs are injected into it. A plot in which the membrane voltage and recorded spikes are displayed is saved to disk.
-
-
module
pynn_brainscales.brainscales2.examples.
plasticity_rule
Functions
-
main
(dict params)
Variables
-
cell_params
= {"threshold_v_threshold": 300,"leak_v_leak": 750,"leak_i_bias": 420,"leak_enable_division": True,"reset_v_reset": 200,"reset_i_bias": 950,"reset_enable_multiplication": True,"threshold_enable": True,"membrane_capacitance_capacitance": 4,"refractory_period_refractory_time": 250,"excitatory_input_enable": True,"excitatory_input_i_bias_tau": 150,"excitatory_input_i_bias_gm": 200,# FIXME: replace by i_drop_input and i_shift_reference# "excitatory_input_v_syn": 700}
-
level
-
log
= pynn.logger.get("plasticity_rule")
-
spiketimes
= main(cell_params)
-
-
module
pynn_brainscales.brainscales2.examples.
single_neuron_demo
Functions
-
plot_membrane_dynamics
(Population population, segment_id=-1) Plot the membrane potential of the neuron in a given population view.
Only population views of size 1 are supported. :param population: Population, membrane traces and spikes are plotted for. :param segment_id: Index of the neo segment to be plotted. Defaults to -1, encoding the last recorded segment.
Variables
-
exc_spiketimes
= [0.01, 0.05, 0.07, 0.08]
-
exc_stim_pop
= pynn.Population(1, SpikeSourceArray(spike_times=exc_spiketimes))
-
inh_spiketimes
= [0.03]
-
inh_stim_pop
= pynn.Population(1, SpikeSourceArray(spike_times=inh_spiketimes))
-
level
-
logger
= pynn.logger.get("single_neuron_demo")
-
p_view
= pynn.PopulationView(pop, [neuron_id])
-
pop
= pynn.Population(1, pynn.cells.HXNeuron(# Leak potential, range: 300-1000leak_v_leak=700,# Leak conductance, range: 0-1022leak_i_bias=1022))
-
receptor_type
-
stimulated_p
-
synapse_type
-
-
module
pynn_brainscales.brainscales2.
helper
Functions
-
chip_from_file
(Path path) Extract chip config from coco file dump.
:param path: path to file containing coco dump.
-
chip_from_nightly
() Extract chip config from nightly calibration.
-
chip_from_portable_binary
(bytes data) Convert portable binary data to chip object.
:param data: Coco list in portable binary format. :return: lola chip configuration.
-
decompose_in_member_names
(str composed_name) Extract member and attribute of a lola.AtomicNeuron from composed name.
This function can be used to retrieve the original name of the member and the attributes of the
lola.AtomicNeuron
for the keys in the dictionary returned byget_values_of_atomic_neuron
. For example ‘multicompartment_i_bias_nmda’ is decomposed in the member ‘multicompartment’ and the attribute ‘i_bias_nmda’.:param composed_name: String which is a combination of a member of the lola.AtomicNeuron and an attribute of it. The two are combined by an underscore. :return: Tuple of the name of the member and the attribute.
-
get_unique_identifier
() Retrieve the unique identifier of the current chip.
Set by Slurm when allocating resources.
-
get_values_of_atomic_neuron
(lola.AtomicNeuron() atomic_neuron, Optional[List[str]] exclude=None) Get values of a LoLa Neuron instance as a dict.
Parse the atomic neuron and save the values of all members and their attributes in a dictionary. The keys of the dictionary are the member’s name and it’s attributes name combined by an underscore.
:param atomic_neuron: Atomic neuron from which to get the values. :param exclude: Members to exclude from parsing. :return: Dictionary with the values saved in the atomic neuron.
-
nightly_calib_path
() Find path for nightly calibration.
-
nightly_calib_url
() Find url for nightly calibration.
Variables
-
ATOMIC_NEURON_MEMBERS
= \[name for name,_in inspect.getmembers(lola.AtomicNeuron())if (not name.startswith("_") and name.islower())]
-
-
module
pynn_brainscales.brainscales2.
morphology
Functions
-
_add_compartments
(lola.Morphology morphology, List[Compartment] compartments) Add compartments to the given morphology.
:param morphology: Morphology to which the compartments are added. :param compartments: Compartments to add to the morphology. :return: Indices of the added compartments.
-
_add_connections
(lola.Morphology morphology, List[SharedLineConnection] connections) Add connections which involve the shared line (somatic line) to the morphology.
:param morphology: Morphology to which the connections are added. :param compartments: Connections to add to the morphology.
-
create_mc_neuron
(str name, List[Compartment] compartments, Optional[List[SharedLineConnection]] connections=None, bool single_active_circuit=False) Create a multicompartment neuron class.
:param name: Name of the newly created class. :param compartments: Compartments of the multicompartment neuron. :param connections: Specifies where the shared line is connected. :param single_active_circuit: Disable leak, capacitance and threshold for all but the first circuit in each comaprtment.
:return: Class for a multi-compartmental neuron model with the given compartments and connections.
-
-
module
pynn_brainscales.brainscales2.morphology.
mc_neuron_base
Functions
-
_expand_to_size
(Any value, int size) Return iterable with the given size.
Return
value
if value already has the desiredsize
otherwise return list withvalue
repeatedsize
times.Examples:
_expand_to_size(1, 3) [1, 1, 1]
_expand_to_size([1, 2], 3) [[1, 2], [1, 2], [1, 2]]
_expand_to_size([1, 2, 3], 3) [1, 2, 3]
-
-
module
parameters
-
module
pynn_brainscales.brainscales2.morphology.
parts
Variables
-
module
plasticity_rules
-
module
populations
-
module
projections
-
module
pynn_brainscales.brainscales2.
recording
Functions
-
normalize_variables_arg
(variables) If variables is a single string, encapsulate it in a list.
-
-
module
recording_data
-
module
standardmodels
-
module
cells
-
module
cells_base
-
module
synapses
-
namespace
std
STL namespace.
-
file
connectors.py
-
file
calibhxneuron.py
-
file
crossbar_event_counter_read.py
-
file
external_input.py
-
file
internal_projections.py
-
file
isi_calib.py
-
file
leak_over_threshold.py
-
file
multicompartment.py
-
file
plasticity_rule.py
-
file
single_neuron_demo.py
-
file
static_recording_synapse.py
-
file
helper.py
-
file
mc_neuron_base.py
-
file
parameters.py
-
file
parts.py
-
file
plasticity_rules.py
-
file
populations.py
-
file
projections.py
-
file
recording.py
-
file
recording_data.py
-
file
simulator.py
-
file
__init__.py
-
file
__init__.py
-
file
__init__.py
-
file
__init__.py
-
file
__init__.py
-
file
cells.py
-
file
cells_base.py
-
file
synapses.py
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTE3OTA.x/pynn-brainscales/brainscales2
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTE3OTA.x/pynn-brainscales/brainscales2/pynn_brainscales/brainscales2
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTE3OTA.x/pynn-brainscales/brainscales2/pynn_brainscales/brainscales2/examples
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTE3OTA.x/pynn-brainscales/brainscales2/pynn_brainscales/brainscales2/morphology
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTE3OTA.x/pynn-brainscales
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTE3OTA.x/pynn-brainscales/brainscales2/pynn_brainscales
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTE3OTA.x/pynn-brainscales/brainscales2/pynn_brainscales/brainscales2/standardmodels