kaira.models.binary.soft_bit_thresholding.RepetitionSoftBitDecoder

Inheritance diagram of RepetitionSoftBitDecoder

Inheritance diagram for RepetitionSoftBitDecoder

class kaira.models.binary.soft_bit_thresholding.RepetitionSoftBitDecoder(repetition_factor: int = 3, soft_combine_method: str = 'mean', thresholder: SoftBitThresholder | None = None, input_type: InputType = InputType.PROBABILITY, *args: Any, **kwargs: Any)[source]

Bases: BaseModel

Enhanced decoder for repetition coding with flexible soft bit processing.

This decoder processes repeated soft bit values with various thresholding techniques. It supports multiple soft input types and different methods for combining repeated values.

Example

With repetition_factor=3, soft_combine_method=’mean’, and thresholder=FixedThresholder: Input [0.2, 0.3, 0.1, 0.8, 0.7, 0.9] becomes [0.0, 1.0]

Methods

__init__

Initialize the repetition soft bit decoder.

forward

Decode the input tensor using soft bit processing.

__init__(repetition_factor: int = 3, soft_combine_method: str = 'mean', thresholder: SoftBitThresholder | None = None, input_type: InputType = InputType.PROBABILITY, *args: Any, **kwargs: Any)[source]

Initialize the repetition soft bit decoder.

Parameters:
  • repetition_factor – Number of times each bit was repeated. Must be a positive integer.

  • soft_combine_method – Method to combine repeated soft values (‘mean’, ‘sum’, ‘median’, ‘max’).

  • thresholder – Optional custom thresholder. If None, uses FixedThresholder with appropriate defaults.

  • input_type – Type of soft input (‘prob’, ‘llr’).

  • *args – Variable positional arguments passed to the base class.

  • **kwargs – Variable keyword arguments passed to the base class.

forward(x: Tensor, *args: Any, **kwargs: Any) Tensor[source]

Decode the input tensor using soft bit processing.

Parameters:
  • x – Input tensor of shape (batch_size, encoded_length), where encoded_length = original_message_length * repetition_factor. Contains soft bit values.

  • *args – Additional positional arguments (passed to thresholder).

  • **kwargs – Additional keyword arguments (passed to thresholder).

Returns:

Decoded binary tensor of shape (batch_size, encoded_length // repetition_factor)