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.populations.Assembly : public pyNN.common.Assembly
Public Functions
-
record
(self, variables, to_file=None, sampling_interval=None, locations=None)¶ 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.
Private Static Attributes
-
_simulator
= simulator¶
-
-
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.
Private Static Functions
-
_check_and_transform
(list lut)¶
-
-
cells.CalibHXNeuronCoba : public cells.CalibHXNeuronCuba
HX Neuron with automated calibration.
Cell parameters correspond to parameters for Calix spiking calibration.
: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.
Available parameters are: v_rest: Resting potential. Value range [50, 160]. v_reset: Reset potential. Value range [50, 160]. v_thresh: Threshold potential. Value range [50, 220]. tau_m: Membrane time constant. Value range [0.5, 60]us. tau_syn_E: Excitatory synaptic input time constant. Value range [0.3, 30]us. tau_syn_E: Inhibitory synaptic input time constant. Value range [0.3, 30]us. cm: Membrane capacitance. Value range [0, 63]. tau_refrac: Refractory time. Value range [.04, 32]us. e_rev_E: Excitatory COBA synaptic input reversal potential. At this potential, the synaptic input strength will be zero. Value range [60, 160]. e_rev_I: Inhibitory COBA synaptic input reversal potential. At this potential, the synaptic input strength will be zero. Value range [60, 160]. 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]. 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]. 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].
Attributes: calib_target: Archive of cell parameters used for last calibration run. Only available after pynn.preprocess() or pynn.run() call. calib_hwparams: Archive of resulting hardware parameters from last calibration run. Only available after pynn.preprocess() or pynn.run() call. acutal_hwparams: Hardware parameters used for actual hardware execution, can be manually adjusted. Only available after pynn.preprocess() or pynn.run() call.
Public Functions
-
add_calib_params
(self, Dict calib_params, List cell_ids)¶
Public Static Attributes
-
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}¶
-
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'}¶
-
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'))¶
-
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"}¶
Private Members
-
_calib_target
¶
-
-
cells.CalibHXNeuronCuba : public StandardCellType , public NetworkAddableCell
HX Neuron with automated calibration.
Cell parameters correspond to parameters for Calix spiking calibration.
:param parameters: Mapping of parameters and corresponding values, i.e. dict. Either 1-dimensional or population size dimensions. Default values are overwritten for specified parameters. Available parameters are: v_rest: Resting potential. Value range [50, 160]. v_reset: Reset potential. Value range [50, 160]. v_thresh: Threshold potential. Value range [50, 220]. tau_m: Membrane time constant. Value range [0.5, 60]us. tau_syn_E: Excitatory synaptic input time constant. Value range [0.3, 30]us. tau_syn_E: Inhibitory synaptic input time constant. Value range [0.3, 30]us. cm: Membrane capacitance. Value range [0, 63]. tau_refrac: Refractory time. Value range [.04, 32]us. 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]. 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]. 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].
Attributes: calib_target: Archive of cell parameters used for last calibration run. Only available after pynn.preprocess() or pynn.run() call. calib_hwparams: Archive of resulting hardware parameters from last calibration run. Only available after pynn.preprocess() or pynn.run() call. acutal_hwparams: Hardware parameters used for actual hardware execution, can be manually adjusted. Only available after pynn.preprocess() or pynn.run() call.
Subclassed by cells.CalibHXNeuronCoba
Public Functions
-
actual_hwparams
(self)¶
-
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)¶
-
calib_target
(self)¶
-
can_record
(self, str variable)¶
Public Static Functions
-
add_to_input_generator
(Population population, grenade.InputGenerator builder)¶
-
add_to_network_graph
(Population population, grenade.NetworkBuilder builder)¶
Public Static Attributes
-
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}¶
-
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'}¶
-
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'))¶
-
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','i_synin_gm_E': 'dimensionless','i_synin_gm_I': 'dimensionless','synapse_dac_bias': 'dimensionless',"v": "dimensionless","exc_synin": "dimensionless","inh_synin": "dimensionless","adaptation": "dimensionless"}¶
-
-
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)¶
-
-
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)¶
Private 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.
-
-
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.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)¶
-
-
cells.HXNeuron : public StandardCellType , public NetworkAddableCell
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.
Subclassed by cells.PlasticHXNeuron
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)¶
-
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 of a LoLa Neuron.
Public Static Functions
-
add_to_input_generator
(Population population, grenade.InputGenerator builder)¶
-
add_to_network_graph
(Population population, grenade.NetworkBuilder builder)¶
-
-
pynn_brainscales.brainscales2.simulator.ID : public int , public IDMixin
-
Private Static Attributes
-
__doc__
= IDMixin.__doc__¶
-
-
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)¶
-
-
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.
Public Static Attributes
-
default_factory
¶
-
-
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.
Public Static Attributes
-
default_factory
¶
-
-
pynn_brainscales.brainscales2.recording.MADCRecorderSetting : public NamedTuple
-
pynn_brainscales.brainscales2.connectors.MapConnector : public pyNN.connectors.MapConnector
Subclassed by pynn_brainscales.brainscales2.connectors.OneToOneConnector
-
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
¶
-
-
pynn_brainscales.brainscales2.morphology.mc_neuron_base.McNeuronBase : public StandardCellType , public NetworkAddableCell , 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_to_network_graph
(Population population, grenade.NetworkBuilder builder)¶
Public Static Attributes
-
Dict
¶
-
LogicalNeuron
¶
-
LogicalNeuronCompartments
¶
-
single_active_circuit
= True¶
-
translations
¶
Private 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.
Private Members
-
_user_provided_parameters
¶
Private 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.
-
cells_base.NetworkAddableCell : public ABC
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
-
-
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.
Private Static Functions
-
_check_and_transform
(list lut)¶
-
-
pynn_brainscales.brainscales2.connectors.OneToOneConnector : public pyNN.connectors.OneToOneConnector , public pynn_brainscales.brainscales2.connectors.MapConnector
-
cells.PlasticHXNeuron : public cells.HXNeuron , public plasticity_rules.PlasticityRuleHandle
HXNeuron with plasticity rule handle.
Currently this includes setting the readout source of each neuron to be available to the plasticity rule.
Public Functions
-
__init__
(self, bool plasticity_rule_enable_readout_source=False, lola.AtomicNeuron.Readout.Source plasticity_rule_readout_source=lola.AtomicNeuron.Readout.Source.membrane, Optional[plasticity_rules.PlasticityRule] plasticity_rule=None, **parameters)¶ parameters
should be a mapping object, e.g.a dict
-
get_default_values
(cls)¶ Get the default values of a LoLa Neuron.
-
to_plasticity_rule_population_handle
(cls, Population population)¶
Public Static Attributes
-
default_parameters
¶
-
ReadoutSource
= lola.AtomicNeuron.Readout.Source¶
-
translations
= {**HXNeuron.translations, **build_translations(("plasticity_rule_readout_source","plasticity_rule_readout_source"),("plasticity_rule_enable_readout_source","plasticity_rule_enable_readout_source"),)}¶
-
-
pynn_brainscales.brainscales2.examples.plasticity_rule.PlasticityRule : public pynn.PlasticityRule
-
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.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.IODataMap 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\¶
-
ObservablePerNeuron
= grenade.PlasticityRule\¶
-
ObservablePerSynapse
= grenade.PlasticityRule\¶
Private 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)¶
Private 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.
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)¶
Private Members
-
_plasticity_rule
¶
Private Static Attributes
-
_simulator
= simulator¶
-
-
synapses.PlasticSynapse : public synapses.StaticSynapse , public 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)¶
Public Static Attributes
-
translations
= build_translations(('weight', 'weight'),('delay', 'delay'))¶
-
-
pynn_brainscales.brainscales2.populations.Population : public pyNN.common.Population
Public Functions
-
__setattr__
(self, name, value)¶
-
actual_hwparams
(self)¶
-
calib_hwparams
(self)¶
-
calib_target
(self)¶
-
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, variables, to_file=None, sampling_interval=None, locations=None)¶ Record the specified variable or variables for all cells in the Population or view.
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.sampling_interval
should be a value in milliseconds, and an integer multiple of the simulation timestep.locations
defines where the variables should be recorded.
Public Static Attributes
-
changed_since_last_run
= True¶
Private 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
Private Members
-
_mask_local
¶
-
-
pynn_brainscales.brainscales2.populations.PopulationView : public pyNN.common.PopulationView
-
Public Static Attributes
-
record
= Population.record¶
-
-
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)¶
Private Functions
-
_convergent_connect
(self, presynaptic_indices, postsynaptic_index, **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)¶
Private 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)¶
-
record
(self, variables, ids, sampling_interval=None, locations=None)¶
Public Members
-
changed_since_last_run
¶
Public Static Attributes
-
madc_variables
= ["v", "exc_synin", "inh_synin", "adaptation"]¶
Private Functions
-
_clear_simulator
(self)¶
-
_configure_madc
(self, Set[str] variables, Set[RecordingSite] recording_sites)¶
-
_get_all_signals
(self, variable, ids, clear=None)¶
-
_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, clear=None)¶ Returns a dict containing the recording site and its spiketimes.
-
_local_count
(self, variable, filter_ids)¶
-
_record
(self, variable, new_ids, sampling_interval=None)¶
-
_reset
(self)¶
Private Static Attributes
-
_simulator
= simulator¶
-
-
synapses.StaticRecordingSynapse.RecordingRule : public 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)¶
-
add_to_network_graph
(self, grenade.NetworkBuilder builder)¶
Properties
-
observables
= property(_get_observables, _set_observables)¶
Private Members
-
_recording_observables
¶
-
-
pynn_brainscales.brainscales2.recording.RecordingSite : public NamedTuple
-
pynn_brainscales.brainscales2.connectors.SmallWorldConnector : public pyNN.connectors.SmallWorldConnector
-
cells.SpikeSourceArray : public NetworkAddableCell
Spike source generating spikes at the times [ms] given in the spike_times array.
Public Functions
-
can_record
(self, str variable)¶
-
-
cells.SpikeSourcePoisson : public NetworkAddableCell
Spike source, generating spikes according to a Poisson process.
Public Functions
-
__init__
(self, start, rate, duration)¶
-
can_record
(self, str variable)¶
-
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_to_network_graph
(Population population, grenade.NetworkBuilder builder)¶
-
-
cells.SpikeSourcePoissonOnChip : public StandardCellType , public NetworkAddableCell
Spike source, generating spikes according to a Poisson process.
Public Static Functions
-
add_to_input_generator
(Population population, grenade.InputGenerator builder)¶
-
add_to_network_graph
(Population population, grenade.NetworkBuilder builder)¶
Public Static Attributes
-
background_source_clock_frequency
¶
-
recordable
= []¶
-
translations
= build_translations(('rate', 'rate'),('seed', 'seed'),)¶
Private Static Attributes
-
_simulator
= simulator¶
-
-
pynn_brainscales.brainscales2.simulator.State : public BaseState
Represent the simulator state.
Public Functions
-
__init__
(self)¶
-
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, Optional[float] runtime)¶ Performs a hardware run for
runtime
milliseconds.If runtime is
None
, we only perform preparatory steps.
-
run_until
(self, tstop)¶
Public Members
-
array_observables
¶
-
background_spike_source_placement
¶
-
calib_cache_dir
¶
-
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_config
¶
-
injected_readout
¶
-
injection_inside_realtime_begin
¶
-
injection_inside_realtime_end
¶
-
injection_post_realtime
¶
-
injection_pre_realtime
¶
-
injection_pre_static_config
¶
-
inside_realtime_begin_read
¶
-
inside_realtime_begin_tickets
¶
-
inside_realtime_end_read
¶
-
inside_realtime_end_tickets
¶
-
log
¶
-
madc_recorder
¶
-
madc_samples
¶
-
max_delay
¶
-
min_delay
¶
-
mpi_rank
¶
-
neuron_placement
¶
-
neuronal_observables
¶
-
num_processes
¶
-
plasticity_rules
¶
-
populations
¶
-
post_realtime_read
¶
-
post_realtime_tickets
¶
-
pre_realtime_read
¶
-
pre_realtime_tickets
¶
-
projections
¶
-
record_sample_times
¶
-
recorders
¶
-
running
¶
-
segment_counter
¶
-
spikes
¶
-
synaptic_observables
¶
-
t
¶
-
t_start
¶
-
times
¶
Private Functions
-
_configure_recorders_populations
(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.
-
_generate_playback_hooks
(self)¶
-
_get_array_observables
(self, grenade.network.NetworkGraph network_graph, grenade.signal_flow.IODataMap 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.IODataMap 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.IODataMap 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.IODataMap outputs)¶ 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: Times and sample values as numpy array
-
_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.
Private Static Functions
-
_get_spikes
(grenade.network.NetworkGraph network_graph, grenade.signal_flow.IODataMap outputs)¶ Get spikes indexed via neuron IDs.
:param network_graph: Network graph to use for lookup of spike label <-> ID relation :param outputs: All outputs of a single execution to extract spikes from :return: Spikes as dict with atomic neuron enum value as key and numpy array of times as value
-
-
synapses.StaticRecordingSynapse : public synapses.StaticSynapse , public plasticity_rules.PlasticityRuleHandle
Synaptic connection with fixed weight and delay.
Public Functions
-
__init__
(self, plasticity_rules.Timer timer, float weight, Set[str] observables)¶
Public Members
-
changed_since_last_run
¶
Properties
-
observables
= property(_get_observables, _set_observables)¶
-
plasticity_rule
= property(_get_plasticity_rule, _set_plasticity_rule)¶
Private Functions
-
_get_observables
(self)¶
-
_get_plasticity_rule
(self)¶
-
_set_observables
(self, Set[str] value)¶
-
_set_plasticity_rule
(self, value)¶
Private Members
-
_observables
¶
-
-
class
synapses.
StaticSynapse
¶ Synaptic connection with fixed weight and delay.
Subclassed by synapses.PlasticSynapse, synapses.StaticRecordingSynapse
Public Static Attributes
-
translations
= build_translations(('weight', 'weight'),('delay', 'delay'))¶
Private Functions
-
_get_minimum_delay
(self)¶
-
-
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)¶
-
-
module
cells
¶
-
module
cells_base
¶
-
namespace
plasticity_rules
¶
-
namespace
pynn
¶
-
namespace
pyNN
¶
-
namespace
common
¶
-
namespace
connectors
¶
-
namespace
recording
¶
-
module
pynn_brainscales
¶
-
module
pynn_brainscales.
brainscales2
¶ 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_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
()¶ Execute all steps needed for the hardware back-end.
Includes place&route of network graph or execution 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 run().
-
run
(*args, **kwargs)¶
-
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.
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
= \¶
-
-
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: :param value: Value to expand. :param size: Size of iterable which should be returned. :return: Iterable with the desired size.
-
-
module
parameters
¶
-
module
pynn_brainscales.brainscales2.morphology.
parts
¶ Variables
-
module
plasticity_rules
¶
-
module
populations
¶
-
module
projections
¶
-
module
recording
¶
-
namespace
std
STL namespace.
-
module
synapses
¶
-
file
__init__.py
-
file
__init__.py
-
file
__init__.py
-
file
__init__.py
-
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
simulator.py
-
file
cells.py
-
file
cells_base.py
-
file
synapses.py
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMiMzODM.x/pynn-brainscales/brainscales2
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMiMzODM.x/pynn-brainscales/brainscales2/pynn_brainscales/brainscales2
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMiMzODM.x/pynn-brainscales/brainscales2/pynn_brainscales/brainscales2/examples
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMiMzODM.x/pynn-brainscales/brainscales2/pynn_brainscales/brainscales2/morphology
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMiMzODM.x/pynn-brainscales
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMiMzODM.x/pynn-brainscales/brainscales2/pynn_brainscales
-
dir
/jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMiMzODM.x/pynn-brainscales/brainscales2/pynn_brainscales/brainscales2/standardmodels