samna.speck2b.configuration#
Submodules#
Module content#
- class samna.speck2b.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.speck2b.configuration.CnnLayerConfig, arg0: str) None #
- property leak_enable#
Enable leak/bias processing for this layer. CAUTION: May impact performance significantly.
- Type:
bool
- 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][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.speck2b.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.speck2b.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.speck2b.configuration.CnnLayerDestination, arg0: str) None #
- property layer#
Target layer ID. Allowed values [0, 8]
- Type:
int
- property pooling#
Pooling will be applied to events before reaching the selected destination layer. Allowed values: {1, 2, 4, 8}
- Type:
int
- to_json(self: samna.speck2b.configuration.CnnLayerDestination) str #
- class samna.speck2b.configuration.CnnLayerDimensions#
Bases:
pybind11_object
Describes the dimensions of a Cnn layer as the configurable parameters on a speck2b.
- from_json(self: samna.speck2b.configuration.CnnLayerDimensions, arg0: str) None #
- get_biases_array_dimensions(self: samna.speck2b.configuration.CnnLayerDimensions) List[int[1]] #
- get_neuron_states_array_dimensions(self: samna.speck2b.configuration.CnnLayerDimensions) List[int[3]] #
- get_weights_array_dimensions(self: samna.speck2b.configuration.CnnLayerDimensions) List[int[4]] #
- property kernel_size#
Kernel size for all features in this layer. All kernels are square. Allowable values [1, 16]
- Type:
int
- 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.speck2b.configuration.CnnLayerDimensions) str #
- class samna.speck2b.configuration.DvsFilterConfig#
Bases:
pybind11_object
The DVS Filter Block is included in the DVS pre-processing layer of Speck v2b in order to filter events depending on neighboring pixel activity. In general, an event at position (x,y) is forwarded by the filter when at least one pixel in the vicinity of (x,y) has spiked in a defined time window before the (x,y) event.
- property filter_bypass#
When ‘1’ (default), the filter is bypassed. When ‘0’, the DVS events are filtered.
- Type:
bool
- property filter_size#
Filter window size in the X/Y dimension.
- Type:
object(x int, y int)
- from_json(self: samna.speck2b.configuration.DvsFilterConfig, arg0: str) None #
- property threashold#
Defines the threshold of the filter. This value is used to compare the current counter value with the value of the pixels neighboring the current spiking pixel. If any of the neighboring pixels has a value difference withing the delta value, the filter emits the current spike. Otherwise, the current spike is blocked.
- Type:
int
- to_json(self: samna.speck2b.configuration.DvsFilterConfig) str #
- class samna.speck2b.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.speck2b.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 speck2b 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)
- to_json(self: samna.speck2b.configuration.DvsLayerConfig) str #
- class samna.speck2b.configuration.DvsLayerDestination#
Bases:
pybind11_object
Configuration options for dvs layer destination. It can have 2 destinations.
- property enable#
if this destination is enabled.
- Type:
bool
- from_json(self: samna.speck2b.configuration.DvsLayerDestination, arg0: str) None #
- property layer#
destination layer that is going to receive output data.
- Type:
int
- to_json(self: samna.speck2b.configuration.DvsLayerDestination) str #
- class samna.speck2b.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.speck2b.configuration.IOShape, arg0: str) None #
- property size#
Size of each feature.
- Type:
object(x int, y int)
- to_json(self: samna.speck2b.configuration.IOShape) str #
- class samna.speck2b.configuration.SpeckConfiguration#
Bases:
pybind11_object
Contains configuration options and network parameters for a speck2b 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_filter#
Instance of
DvsFilterConfig
- property dvs_layer#
Instance of
DvsLayerConfig
- property factory_config#
Instance of
FactoryConfig
.
- from_json(self: samna.speck2b.configuration.SpeckConfiguration, arg0: str) None #
- property readout#
Instance of
ReadoutConfig
.
- to_json(self: samna.speck2b.configuration.SpeckConfiguration) str #