samna.dynapcnn.configuration#

Submodules#

Module content#

class samna.dynapcnn.configuration.CNNLayerConfig#

Bases: pybind11_object

Configuration options for CNN layer config.

property biases#

Contains bias values for features in a layer.

Formatted as [feature].

Type:

tensor array

property biases_kill_bit#

Contains bias kill values for features in a layer.

Kill bits control whether a specific bias value will be used during processing. A 0 entry enables the bias while a 1 entry disables it. All bias values are enabled by default.

Formatted as [feature].

Type:

tensor array

property destinations#

List of 2 CNNLayerDestination which describe target destination layers for events produced in this layer.

Type:

Array of 2 fixed length

property dimensions#

Specifies padding, stride, kernel size and I/O shape of the layer.

Type:

Instance of CNNLayerDimensions

from_json(self: samna.dynapcnn.configuration.CNNLayerConfig, arg0: str) None#
property leak_enable#

May impact performance significantly.

Type:

bool

Type:

Enable leak/bias processing for this layer. CAUTION

property monitor_enable#

Enable monitoring of this layer. When True all events produced by this layer will also be output on the monitoring bus. When False, events will only go to layers selected in the destinations list.

Monitoring should only be enabled on development kits that support fast readout of events.

Type:

bool

property neurons_initial_value#

Contains initial neuron membrane potential values for neurons in a layer.

Formatted as [feature][channel][x][y].

Type:

tensor array

property neurons_value_kill_bit#

Contains neuron membrane potential kill values for neurons in a layer.

Kill bits control whether a specific neuron value will be used during processing. A 0 entry enables the neuron while a 1 entry disables it. All neuron values are enabled by default.

Formatted as [feature][channel][x][y].

Type:

tensor array

property return_to_zero#

If True neurons in this layer will return to 0 when firing. Otherwise their threshold will be subtracted from the value their membrane potential reached before firing.

Type:

bool

property threshold_high#

Set the high threshold. When the neuron membrane potential becomes equal to or great than this value the neuron will fire.

Type:

int

property threshold_low#

The minimum value of the neuron membrane potential which cannot be surpassed by leak.

Type:

int

to_json(self: samna.dynapcnn.configuration.CNNLayerConfig) str#
property weights#

4 dimensional list of lists representing kernel parameters.

Formatted as [feature][channel][x][y].

Type:

tensor array

property weights_kill_bit#

4 dimensional list of lists representing kernel kill bits.

Kill bits control whether a specific kernel value will be used during processing. A 0 entry enables the kernel while a 1 entry disables it. All kernel values are enabled by default.

Formatted as [feature][channel][x][y].

Type:

tensor array

class samna.dynapcnn.configuration.CNNLayerDestination#

Bases: pybind11_object

Configuration options for CNN layer destinations.

property enable#

Enable this destination. If False no events will be forwarded, if True all events will be forwarded to this destination.

Type:

bool

property feature_shift#

Shift feature IDs. The feature ID observed in the target layer will be the ID in this layer + feature_shift.

Type:

int

from_json(self: samna.dynapcnn.configuration.CNNLayerDestination, arg0: str) None#
property layer#

Target layer ID. Allowed values [0, 8]

Type:

int

property pooling#

{1, 2, 4}

Type:

int

Type:

Pooling will be applied to events before reaching the selected destination layer. Allowed values

to_json(self: samna.dynapcnn.configuration.CNNLayerDestination) str#
class samna.dynapcnn.configuration.CNNLayerDimensions#

Bases: pybind11_object

Describes the dimensions of a CNN layer as the configurable parameters on a DYNAP-CNN.

from_json(self: samna.dynapcnn.configuration.CNNLayerDimensions, arg0: str) None#
get_biases_array_dimensions(self: samna.dynapcnn.configuration.CNNLayerDimensions) List[int[1]]#
get_neuron_states_array_dimensions(self: samna.dynapcnn.configuration.CNNLayerDimensions) List[int[3]]#
get_weights_array_dimensions(self: samna.dynapcnn.configuration.CNNLayerDimensions) List[int[4]]#
property input_shape#

Shape of features on the input of this layer.

Type:

Instance of IOShape

property kernel_size#

Kernel size for all features in this layer. All kernels are square. Allowable values [1, 16]

Type:

int

property output_shape#

Shape of features on the output of this layer.

Type:

Instance of IOShape

property padding#

Padding of all features in this layer. Allowable values [0, 7].

Type:

object(x int, y int)

property stride#

Stride for all features in this layer. Allowable values {1, 2, 4, 8}.

Type:

object(x int, y int)

to_json(self: samna.dynapcnn.configuration.CNNLayerDimensions) str#
class samna.dynapcnn.configuration.DVSLayerConfig#

Bases: pybind11_object

Configuration options for dvs layer config. dvs layer can handle dvs events.

property cut#

Select the cut range, the roi cut happens concurrently, the range needs to be defined from the sensors (original) origin).

Actually it cuts an area using the given size based on (0, 0) first, then adjust this area according to origin.

Type:

object(x int, y int)

property destinations#

destination layers to give events, every layer can have 2 destinations

Type:

array with 2 fixed length

from_json(self: samna.dynapcnn.configuration.DVSLayerConfig, arg0: str) None#
property merge#

Whether merge the two polarity from dvs (On/Off).

If True, Merge all events marking them with Polarity = ‘1’. If False, Pass all events and maintain the polarity information.

Type:

bool

property mirror#

Enable mirroring (1) or not (0) of the X or Y dimension. mirroring is reversing image on X or Y dimension.

Type:

object(x bool, y bool)

property mirror_diagonal#

Enables mirroring of the input events along the diagonal. when set to ‘1’, it swaps X with Y.

Type:

bool

property monitor_enable#

Enables the DVS Pre-Processing Spike Monitor Bus. When enabled, output messages of the dvs pre-processing block are forwarded on the monitor bus to the output serial interface data1 input.

This is typically openned when you want dynapcnn to output dvs events.

Type:

bool

property monitor_sensor_enable#

Enables the DVS Monitor Bus. When enabled, input messages to the dvs pre-processing block are forwarded on the monitor bus to the output serial interface data1 input.

These messages are the raw messages coming from the internal DVS or an external sensor (Ext DVS Mode) before pre-processing.

Type:

bool

property off_channel#

Whether pass events with OFF polarity, only make sense when merge equal to True.

If True, pass events with OFF polarity. If False, block events with OFF polarity

Type:

bool

property on_channel#

Whether pass events with ON polarity, only make sense when merge equal to True.

If True, pass events with ON polarity. If False, block events with ON polarity

Type:

bool

property origin#

Select the origin offset the roi cut happens concurrently, the offset needs to be defined from the sensors (original) origin).

Actually this origin will redefined the area after cut.

Type:

object(x int, y int)

property pass_sensor_events#

Pass/Drop Internal DVS Events. If disabled, the internal sensor events are dropped, i.e., not forwarded to the DVS pre-processing block.

This is typically used when sensor data is provided by an external source (Ext DVS Mode).

Type:

bool

property pooling#

Pooling is restricting dvs events in an area, available values are {1, 2, 4}, you can set pooling value on X/Y dimension seperately.

For example, if you set config.dvs_layer.pooling.x = 2 and config.dvs_layer.pooling.y = 2, you will see a 1/4 area on top left of visualizer which show pixels and other areas will be blank

Type:

object(x int, y int)

property sensor_timing#

delay used for programming the kill switches in the pixels

Type:

int

to_json(self: samna.dynapcnn.configuration.DVSLayerConfig) str#
class samna.dynapcnn.configuration.DVSLayerDestination#

Bases: pybind11_object

Configuration options for dvs layer destination. every layer can have 2 destinations.

property enable#

if this destination is enabled.

Type:

bool

from_json(self: samna.dynapcnn.configuration.DVSLayerDestination, arg0: str) None#
property layer#

destination layer that is going to receive output data.

Type:

int

to_json(self: samna.dynapcnn.configuration.DVSLayerDestination) str#
class samna.dynapcnn.configuration.DVSProbePoint#

Bases: pybind11_object

Members:

Disabled

ImageMerge

Pooling

ImageCut_ROI

DVSToRouter

EncoderHead0

EncoderHead1

EncoderHead2

EncoderRow0

EncoderRow1

EncoderRow2

EncoderColumn0

EncoderColumn1

EncoderColumn2

EncoderColumn3

EncoderColumn4

property name#
class samna.dynapcnn.configuration.DynapcnnConfiguration#

Bases: pybind11_object

Contains configuration options and network parameters for a DYNAP-CNN device. Applied to a device via apply_configuration() on the device model.

The configuration is divided into settings for the 9 CNN layers, the DVS event preprocessing layer and the readout layer. The factory configuration and debug configuration sub structs are pre-populated with default values and are only used for debug scenarios.

property cnn_layers#

List of 9 CNNLayerConfig.

property debug_config#

Instace of DebugConfig

property dvs_layer#

Instance of DVSLayerConfig

property factory_settings#

Instance of FactorySettings.

from_json(self: samna.dynapcnn.configuration.DynapcnnConfiguration, arg0: str) None#
property readout#

Instance of ReadoutConfig.

to_json(self: samna.dynapcnn.configuration.DynapcnnConfiguration) str#
class samna.dynapcnn.configuration.FactorySettings#

Bases: pybind11_object

Configuration options for factory settings.

from_json(self: samna.dynapcnn.configuration.FactorySettings, arg0: str) None#
property monitor_input_enable#

Enable input monitoring. default false, when enabled, all input events will be outputted as InputInterfaceEvent. this is usually used for debugging.

Type:

bool

to_json(self: samna.dynapcnn.configuration.FactorySettings) str#
class samna.dynapcnn.configuration.IOShape#

Bases: pybind11_object

Describes the input or output shape of a CNN layer.

property feature_count#

Number of features in the input or output”

Type:

int

from_json(self: samna.dynapcnn.configuration.IOShape, arg0: str) None#
property size#

Size of each feature.

Type:

object(x int, y int)

to_json(self: samna.dynapcnn.configuration.IOShape) str#
class samna.dynapcnn.configuration.KernelSectionProbePoint#

Bases: pybind11_object

Members:

Disabled

ZeroPadding

ConvolutionAnker

ConvolutionFlowCTLLoopChannel

ConvolutionBufferInLoopChannel

ConvolutionDecoderInLoopChannel

ConvolutionBufferAfterLoopChannel

ConvolutionFlowCTLLoopX

ConvolutionBufferInLoopX

ConvolutionCheckDecoderInLoopX

ConvolutionBufferAfterLoopX

ConvolutionFlowCTLLoopY

ConvolutionBufferInLoopY

ConvolutionCheckDecoderInLoopY

CompressBlockA

CompressBlockB

property name#
class samna.dynapcnn.configuration.LeakProbePoint#

Bases: pybind11_object

Members:

Disabled

KernelRW0

KernelRW1

LeakRW0

LeakRW1

ClockToHighSpeed

FlowControlLoop0

DecoderLoop0

BufferAfterLoop0

BufferAfterSRAM

FlowControlLoop1

DecoderLoop1

BufferAfterLoop1

FlowControlLoop2

DecoderLoop2

LeakEventCompress

property name#
class samna.dynapcnn.configuration.NeuronProbePoint#

Bases: pybind11_object

Members:

Disabled

RWBlockA0

RWBlockA1

ThresholdComputeA0

FlowCTLBlockA1

RWBlockB0

RWBlockB1

ThresholdComputeB0

FlowCTLBlockB1

NeuronSpikeIn

NeuronLeakIn

NeuronRWIn

NeuronToMem

AddressDecompress

SpikeHeaderA

SpikeHeaderB

property name#
class samna.dynapcnn.configuration.ProbePointRouter0#

Bases: pybind11_object

Members:

Disabled

B2DLSB

B2DMSB

BufferAfterLSBAndMSBMerge

AERSRAMToC0Buffer

AERSRAMToC1Buffer

AERSRAMToC2Buffer

AERSRAMToC3Buffer

AERSRAMToC4Buffer

AERSRAMToC5Buffer

AERSRAMToC6Buffer

AERSRAMToC7Buffer

AERSRAMToC8Buffer

EventToRouterBuffer

AERSRAMToDVSBuffer

AERSRAMEventInToMonitorBufferBeforeFIFO

MonitorRouterFromDVS

MonitorRouterFromII

MonitorRouterFromC8

MonitorRouterFromC0

MonitorRouterFromC1

MonitorRouterFromC2

MonitorRouterFromC3

MonitorRouterFromC4

MonitorRouterFromC5

MonitorRouterFromC6

MonitorRouterFromC7

IIToDVSPre

DVSToC0

C8ToC0

C0ToC0

C1ToC0

property name#
class samna.dynapcnn.configuration.ProbePointRouter1#

Bases: pybind11_object

Members:

C2ToC0

C3ToC0

C4ToC0

C5ToC0

C6ToC0

C7ToC0

DVSToC1

C8ToC1

C0ToC1

C1ToC1

C2ToC1

C3ToC1

C4ToC1

C5ToC1

C6ToC1

C7ToC1

DVSToC2

C8ToC2

C0ToC2

C1ToC2

C2ToC2

C3ToC2

C4ToC2

C5ToC2

C6ToC2

C7ToC2

DVSToC3

C8ToC3

C0ToC3

C1ToC3

C2ToC3

C3ToC3

property name#
class samna.dynapcnn.configuration.ProbePointRouter2#

Bases: pybind11_object

Members:

C4ToC3

C5ToC3

C6ToC3

C7ToC3

DVSToC4

C8ToC4

C0ToC4

C1ToC4

C2ToC4

C3ToC4

C4ToC4

C5ToC4

C6ToC4

C7ToC4

DVSToC5

C8ToC5

C0ToC5

C1ToC5

C2ToC5

C3ToC5

C4ToC5

C5ToC5

C6ToC5

C7ToC5

DVSToC6

C8ToC6

C0ToC6

C1ToC6

C2ToC6

C3ToC6

C4ToC6

C5ToC6

property name#
class samna.dynapcnn.configuration.ProbePointRouter3#

Bases: pybind11_object

Members:

C6ToC6

C7ToC6

DVSToC7

C8ToC7

C0ToC7

C1ToC7

C2ToC7

C3ToC7

C4ToC7

C5ToC7

C6ToC7

C7ToC7

DVSToReadout

C8ToReadout

C0ToReadout

C1ToReadout

C2ToReadout

C3ToReadout

C4ToReadout

C5ToReadout

C6ToReadout

C7ToReadout

DVSToC8

C8ToC8

C0ToC8

C1ToC8

C2ToC8

C3ToC8

C4ToC8

C5ToC8

C6ToC8

C7ToC8

property name#
class samna.dynapcnn.configuration.ReadoutProbePoint#

Bases: pybind11_object

Members:

ReadoutChannel0

ReadoutChannel1

ReadoutChannel2

ReadoutChannel3

ReadoutChannel4

ReadoutChannel5

ReadoutChannel6

ReadoutChannel7

ReadoutChannel8

ReadoutChannel9

ReadoutChannel10

ReadoutChannel11

ReadoutChannel12

ReadoutChannel13

ReadoutChannel14

ReadoutChannel15

property name#