kaira.models.binary.soft_bit_thresholding.MinDistanceThresholder

Inheritance diagram of MinDistanceThresholder

Inheritance diagram for MinDistanceThresholder

class kaira.models.binary.soft_bit_thresholding.MinDistanceThresholder(reference_points: Tensor | None = None, noise_var: float = 1.0, input_type: InputType = InputType.PROBABILITY, *args: Any, **kwargs: Any)[source]

Bases: SoftBitThresholder

Thresholder based on minimum distance calculations.

Uses minimum distance to constellation points to make hard decisions, similar to how demodulators work in communication systems.

This is particularly useful for signals that have been transmitted through a channel and may have complex noise characteristics.

Methods

__init__

Initialize the minimum distance thresholder.

forward

Apply minimum distance thresholding to convert soft bit values to hard decisions.

to

Move the model to the specified device.

__init__(reference_points: Tensor | None = None, noise_var: float = 1.0, input_type: InputType = InputType.PROBABILITY, *args: Any, **kwargs: Any)[source]

Initialize the minimum distance thresholder.

Parameters:
  • reference_points – Reference points for distance calculation (constellation). If None, defaults to [0.0, 1.0] for probabilities or [-2.0, 2.0] for LLRs.

  • noise_var – Noise variance used in soft distance calculations.

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

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

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

forward(x: Tensor, noise_var: float | None = None, *args: Any, **kwargs: Any) Tensor[source]

Apply minimum distance thresholding to convert soft bit values to hard decisions.

Parameters:
  • x – Input tensor of soft bit values.

  • noise_var – Optional override for noise variance.

  • *args – Additional positional arguments (unused).

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

Returns:

Tensor of hard bit decisions (0.0 or 1.0).

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.