kaira.models.image.Tung2022DeepJSCCQ2Encoder

Inheritance diagram for Tung2022DeepJSCCQ2Encoder
- class kaira.models.image.Tung2022DeepJSCCQ2Encoder(N: int, M: int, in_ch: int = 3, csi_length: int = 1, *args: Any, **kwargs: Any)[source]
Bases:
BaseModelDeepJSCCQ2 Encoder Module [Tung et al., 2022].
This module is from the conference paper, not the journal version. Note that this module is different than DeepJSCCQ, which contains 4 strided layers and does not contain the AFModule.
This module encodes an image into a latent representation using a series of convolutional layers and AFModules.
Methods
Initialize the DeepJSCCQ2Encoder.
Forward pass through the encoder.
Create model instance from configuration.
Create model from Hydra DictConfig.
Create model from Hugging Face PretrainedConfig.
Attributes
Calculate the bandwidth ratio of the model.
- __init__(N: int, M: int, in_ch: int = 3, csi_length: int = 1, *args: Any, **kwargs: Any) None[source]
Initialize the DeepJSCCQ2Encoder.
- Parameters:
N (int) – The number of input channels or feature maps in the neural network model.
M (int) – The number of output channels in the final layer of the neural network.
in_ch (int, optional) – The number of input channels. Defaults to 3.
csi_length (int, optional) – The number of dimensions in the CSI (Channel State Information) data.
*args – Variable positional arguments passed to the base class.
**kwargs – Variable keyword arguments passed to the base class.
- property bandwidth_ratio: float
Calculate the bandwidth ratio of the model.
- Returns:
The bandwidth ratio.
- Return type:
- forward(x: Tensor, csi: Tensor, *args: Any, **kwargs: Any) Tensor[source]
Forward pass through the encoder.
- Parameters:
x (torch.Tensor) – The input image tensor.
csi (torch.Tensor) – Channel State Information tensor.
*args – Additional positional arguments.
**kwargs – Additional keyword arguments.
- Returns:
The encoded latent representation.
- Return type:
- 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