samna.speck2.event#

Submodules#

Module content#

samna.speck2.event.assemble_request_to_match_events(arg0: bool, arg1: List[samna.speck2.event.RouterEvent | samna.speck2.event.DvsEvent | samna.speck2.event.KillSensorPixel | samna.speck2.event.ResetSensorPixel | samna.speck2.event.WriteNeuronValue | samna.speck2.event.ReadNeuronValue | samna.speck2.event.WriteWeightValue | samna.speck2.event.ReadWeightValue | samna.speck2.event.WriteBiasValue | samna.speck2.event.ReadBiasValue | samna.speck2.event.WriteRegisterValue | samna.speck2.event.ReadRegisterValue | samna.speck2.event.WriteMemoryValue | samna.speck2.event.ReadMemoryValue]) Tuple[bool, List[samna.speck2.event.RouterEvent | samna.speck2.event.DvsEvent | samna.speck2.event.KillSensorPixel | samna.speck2.event.ResetSensorPixel | samna.speck2.event.WriteNeuronValue | samna.speck2.event.ReadNeuronValue | samna.speck2.event.WriteWeightValue | samna.speck2.event.ReadWeightValue | samna.speck2.event.WriteBiasValue | samna.speck2.event.ReadBiasValue | samna.speck2.event.WriteRegisterValue | samna.speck2.event.ReadRegisterValue | samna.speck2.event.WriteMemoryValue | samna.speck2.event.ReadMemoryValue]]#

Assemble the request to match events.

Parameters:
  • isContextSensitiveEventActive (bool) – Whether the context sensitive event is active.

  • events (speck2.event.InputEvent) – The events to assemble.

Returns:

A list of input events.

samna.speck2.event.decode_context_sensitive_event(arg0: samna.speck2.event.ContextSensitiveEvent, arg1: samna.speck2.event.RouterEvent | samna.speck2.event.DvsEvent | samna.speck2.event.KillSensorPixel | samna.speck2.event.ResetSensorPixel | samna.speck2.event.WriteNeuronValue | samna.speck2.event.ReadNeuronValue | samna.speck2.event.WriteWeightValue | samna.speck2.event.ReadWeightValue | samna.speck2.event.WriteBiasValue | samna.speck2.event.ReadBiasValue | samna.speck2.event.WriteRegisterValue | samna.speck2.event.ReadRegisterValue | samna.speck2.event.WriteMemoryValue | samna.speck2.event.ReadMemoryValue) samna.speck2.event.Spike | samna.speck2.event.DvsEvent | samna.speck2.event.InputInterfaceEvent | samna.speck2.event.S2PMonitorEvent | samna.speck2.event.NeuronValue | samna.speck2.event.BiasValue | samna.speck2.event.WeightValue | samna.speck2.event.RegisterValue | samna.speck2.event.MemoryValue | samna.speck2.event.ReadoutValue | samna.speck2.event.ContextSensitiveEvent#

Decodes a context sensitive event.

Parameters:
  • event (speck2.event.ContextSensitiveEvent) – The event to decode.

  • requestToMatch (speck2.event.InputEvent) – The request to match.

Returns:

The decoded event.

samna.speck2.event.decode_context_sensitive_event_as_readout_event(arg0: samna.speck2.event.ContextSensitiveEvent) samna.speck2.event.Spike | samna.speck2.event.DvsEvent | samna.speck2.event.InputInterfaceEvent | samna.speck2.event.S2PMonitorEvent | samna.speck2.event.NeuronValue | samna.speck2.event.BiasValue | samna.speck2.event.WeightValue | samna.speck2.event.RegisterValue | samna.speck2.event.MemoryValue | samna.speck2.event.ReadoutValue | samna.speck2.event.ContextSensitiveEvent#

Decodes a context sensitive event into a readout event.

Parameters:

event (speck2.event.ContextSensitiveEvent) – The event to decode.

Returns:

The decoded readout event.

samna.speck2.event.decode_input_interface_events(arg0: List[int]) List[samna.speck2.event.RouterEvent | samna.speck2.event.DvsEvent | samna.speck2.event.KillSensorPixel | samna.speck2.event.ResetSensorPixel | samna.speck2.event.WriteNeuronValue | samna.speck2.event.ReadNeuronValue | samna.speck2.event.WriteWeightValue | samna.speck2.event.ReadWeightValue | samna.speck2.event.WriteBiasValue | samna.speck2.event.ReadBiasValue | samna.speck2.event.WriteRegisterValue | samna.speck2.event.ReadRegisterValue | samna.speck2.event.WriteMemoryValue | samna.speck2.event.ReadMemoryValue]#

Decodes input interface events.

Parameters:

events (int) – The events to decode.

Returns:

The decoded input events.

samna.speck2.event.decode_output_event(arg0: int) samna.speck2.event.Spike | samna.speck2.event.DvsEvent | samna.speck2.event.InputInterfaceEvent | samna.speck2.event.S2PMonitorEvent | samna.speck2.event.NeuronValue | samna.speck2.event.BiasValue | samna.speck2.event.WeightValue | samna.speck2.event.RegisterValue | samna.speck2.event.MemoryValue | samna.speck2.event.ReadoutValue | samna.speck2.event.ContextSensitiveEvent#

Decodes an output event.

Parameters:

rawEvent (int) – The event to decode.

Returns:

The decoded output event.

samna.speck2.event.encode_input_interface_event(arg0: Union[samna.speck2.event.RouterEvent, samna.speck2.event.DvsEvent, samna.speck2.event.KillSensorPixel, samna.speck2.event.ResetSensorPixel, samna.speck2.event.WriteNeuronValue, samna.speck2.event.ReadNeuronValue, samna.speck2.event.WriteWeightValue, samna.speck2.event.ReadWeightValue, samna.speck2.event.WriteBiasValue, samna.speck2.event.ReadBiasValue, samna.speck2.event.WriteRegisterValue, samna.speck2.event.ReadRegisterValue, samna.speck2.event.WriteMemoryValue, samna.speck2.event.ReadMemoryValue], arg1: bool, arg2: bool, arg3: bool, arg4: std::back_insert_iterator<std::vector<unsigned long, std::allocator<unsigned long> > >) None#

Encodes an input interface event.

Parameters:
  • event (speck2.event.InputEvent) – The event to encode.

  • isFirst (bool) – Whether this is the first event.

  • isCompressible (bool) – Whether this event is compressible.

  • isLast (bool) – Whether this is the last event.

  • outputEvents (speck2.event.OutputEvent) – The output events.

samna.speck2.event.encode_input_interface_events(arg0: List[samna.speck2.event.RouterEvent | samna.speck2.event.DvsEvent | samna.speck2.event.KillSensorPixel | samna.speck2.event.ResetSensorPixel | samna.speck2.event.WriteNeuronValue | samna.speck2.event.ReadNeuronValue | samna.speck2.event.WriteWeightValue | samna.speck2.event.ReadWeightValue | samna.speck2.event.WriteBiasValue | samna.speck2.event.ReadBiasValue | samna.speck2.event.WriteRegisterValue | samna.speck2.event.ReadRegisterValue | samna.speck2.event.WriteMemoryValue | samna.speck2.event.ReadMemoryValue]) List[int]#

Encodes input interface events.

Parameters:

events (speck2.event.InputEvent) – The events to encode.

Returns:

A tuple containing configuration, normal and raw packets.

samna.speck2.event.speck_configuration_to_event(arg0: samna.speck2.configuration.SpeckConfiguration) List[samna.speck2.event.RouterEvent | samna.speck2.event.DvsEvent | samna.speck2.event.KillSensorPixel | samna.speck2.event.ResetSensorPixel | samna.speck2.event.WriteNeuronValue | samna.speck2.event.ReadNeuronValue | samna.speck2.event.WriteWeightValue | samna.speck2.event.ReadWeightValue | samna.speck2.event.WriteBiasValue | samna.speck2.event.ReadBiasValue | samna.speck2.event.WriteRegisterValue | samna.speck2.event.ReadRegisterValue | samna.speck2.event.WriteMemoryValue | samna.speck2.event.ReadMemoryValue]#

Get the input events for the given Speck configuration.

Parameters:

config (speck2.configuration.SpeckConfiguration) – The configuration to turn into events.

Returns:

A list of input events.