kaira.models.binary.soft_bit_thresholding.SoftBitThresholder

Inheritance diagram for SoftBitThresholder
- class kaira.models.binary.soft_bit_thresholding.SoftBitThresholder(dtype: dtype | None = None, device: str | device | None = None, *args: Any, **kwargs: Any)[source]
Bases:
BaseModelBase class for soft bit thresholding techniques.
This abstract class defines the interface for soft bit thresholders that convert soft bit representations (e.g., probabilities, LLRs) to hard binary decisions.
Soft bit thresholding is a key technique in modern communication systems for extracting reliable information from noisy channel outputs.
Implementers must override the forward method.
Methods
Initialize the soft bit thresholder.
Apply thresholding to convert soft bit values to hard decisions.
Create model instance from configuration.
Create model from Hydra DictConfig.
Create model from Hugging Face PretrainedConfig.
Move the model to the specified device.
- __init__(dtype: dtype | None = None, device: str | device | None = None, *args: Any, **kwargs: Any)[source]
Initialize the soft bit thresholder.
- Parameters:
dtype – The data type for tensors used by this model.
device – The device (CPU/CUDA) where tensors should be allocated.
*args – Variable positional arguments passed to the base class.
**kwargs – Variable keyword arguments passed to the base class.
- to(device: str | device, *args, **kwargs) SoftBitThresholder[source]
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.
- forward(x: Tensor, *args: Any, **kwargs: Any) Tensor[source]
Apply thresholding to convert soft bit values to hard decisions.
- Parameters:
x – Input tensor of soft bit values.
*args – Additional positional arguments.
**kwargs – Additional keyword arguments.
- Returns:
Tensor of hard bit decisions (0.0 or 1.0).
- classmethod from_config(config, **kwargs)
Create model instance from configuration.
- Parameters:
config – Configuration object (PretrainedConfig, DictConfig, or dict)
**kwargs – Additional parameters to override config
- Returns:
Model instance
- classmethod from_hydra_config(config: DictConfig, **kwargs)
Create model from Hydra DictConfig.
- Parameters:
config – Hydra configuration
**kwargs – Additional parameters
- Returns:
Model instance
- classmethod from_pretrained_config(config: PretrainedConfig, **kwargs)
Create model from Hugging Face PretrainedConfig.
- Parameters:
config – PretrainedConfig instance
**kwargs – Additional parameters
- Returns:
Model instance