kaira.models.binary.soft_bit_thresholding.LLRThresholder

Inheritance diagram of LLRThresholder

Inheritance diagram for LLRThresholder

class kaira.models.binary.soft_bit_thresholding.LLRThresholder(threshold: float = 0.0, confidence_scaling: float = 1.0, output_type: OutputType = OutputType.HARD, *args: Any, **kwargs: Any)[source]

Bases: SoftBitThresholder

Specialized thresholder for Log-Likelihood Ratio (LLR) values.

Handles LLR values properly, optionally applying scaling or other transformations before thresholding. For LLRs, positive values favor bit=0, negative values favor bit=1.

Can also output soft probabilities instead of hard decisions if required.

Methods

__init__

Initialize the LLR thresholder.

forward

Process LLR values to produce bit decisions or probabilities.

to

Move the model to the specified device.

__init__(threshold: float = 0.0, confidence_scaling: float = 1.0, output_type: OutputType = OutputType.HARD, *args: Any, **kwargs: Any)[source]

Initialize the LLR thresholder.

Parameters:
  • threshold – The threshold value to use. Default is 0.0 for LLRs.

  • confidence_scaling – Scaling factor applied to LLRs to adjust confidence.

  • output_type – Output type, either ‘hard’ for binary decisions or ‘soft’ for probabilities.

  • *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]

Process LLR values to produce bit decisions or probabilities.

Parameters:
  • x – Input tensor of LLR values.

  • *args – Additional positional arguments (unused).

  • **kwargs – Additional keyword arguments (unused).

Returns:

Tensor of bit values, either hard (0.0 or 1.0) or soft (probabilities).

to(device: str | device, *args, **kwargs) SoftBitThresholder

Move the model to the specified device.

Parameters:
  • device – The device to move the model to.

  • *args – Additional positional arguments for nn.Module.to().

  • **kwargs – Additional keyword arguments for nn.Module.to().

Returns:

Self for method chaining.