pynn_brainscales.brainscales2.PlasticityRule

class pynn_brainscales.brainscales2.PlasticityRule(timer: Timer, observables: Optional[Dict[str, Union[ObservablePerSynapse, ObservablePerNeuron, ObservableArray]]] = None)

Bases: object

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.

__init__(timer: Timer, observables: Optional[Dict[str, Union[ObservablePerSynapse, ObservablePerNeuron, ObservableArray]]] = None)

Create a new plasticity rule with timing information.

Parameters

timer – Timer object.

Methods

__init__(timer[, observables])

Create a new plasticity rule with timing information.

add_to_network_graph(builder, …)

generate_kernel()

Generate plasticity rule kernel to be compiled into PPU program.

get_data(network_graph, outputs)

Get synaptic and neuron observables of plasticity rule.

get_observable_array(observable)

Get data for an array observable.

Attributes

observables

timer

class ObservableArray

Bases: pybind11_builtins.pybind11_object

class Type

Bases: pybind11_builtins.pybind11_object

class Int16

Bases: pybind11_builtins.pybind11_object

class Int8

Bases: pybind11_builtins.pybind11_object

class UInt16

Bases: pybind11_builtins.pybind11_object

class UInt8

Bases: pybind11_builtins.pybind11_object

int16 = int16
int8 = int8
uint16 = uint16
uint8 = uint8
property size
property type
class ObservablePerNeuron

Bases: pybind11_builtins.pybind11_object

class Layout

Bases: pybind11_builtins.pybind11_object

Members:

complete_row

packed_active_columns

complete_row = <Layout.complete_row: 0>
property name
packed_active_columns = <Layout.packed_active_columns: 1>
property value
class Type

Bases: pybind11_builtins.pybind11_object

class Int16

Bases: pybind11_builtins.pybind11_object

class Int8

Bases: pybind11_builtins.pybind11_object

class UInt16

Bases: pybind11_builtins.pybind11_object

class UInt8

Bases: pybind11_builtins.pybind11_object

int16 = int16
int8 = int8
uint16 = uint16
uint8 = uint8
property layout
property type
class ObservablePerSynapse

Bases: pybind11_builtins.pybind11_object

class LayoutPerRow

Bases: pybind11_builtins.pybind11_object

Members:

complete_rows

packed_active_columns

complete_rows = <LayoutPerRow.complete_rows: 0>
property name
packed_active_columns = <LayoutPerRow.packed_active_columns: 1>
property value
class Type

Bases: pybind11_builtins.pybind11_object

class Int16

Bases: pybind11_builtins.pybind11_object

class Int8

Bases: pybind11_builtins.pybind11_object

class UInt16

Bases: pybind11_builtins.pybind11_object

class UInt8

Bases: pybind11_builtins.pybind11_object

int16 = int16
int8 = int8
uint16 = uint16
uint8 = uint8
property layout_per_row
property type
add_to_network_graph(builder: _pygrenade_vx_network.NetworkBuilder, snippet_begin_time, snippet_end_time)_pygrenade_vx_network.PlasticityRuleOnNetwork
generate_kernel()str

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.

Returns

PPU-code of plasticity-rule kernel as string.

get_data(network_graph: grenade.NetworkGraph, outputs: grenade_signal_flow.OutputData)grenade.PlasticityRule.RecordingData

Get synaptic and neuron observables of plasticity rule.

Parameters
  • network_graph – Network graph to use for lookup of MADC output vertex descriptor.

  • outputs – All outputs of a single execution to extract samples from.

Returns

Recording data.

get_observable_array(observable: str)object

Get data for an array observable.

Parameters

observable – Name of observable.

Returns

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.

  • TypeError – If observable is not an ObservableArray.

property observables
property timer