kaira.models.components.MLPDecoder

Inheritance diagram for MLPDecoder
- class kaira.models.components.MLPDecoder(in_features: int, out_features: int, hidden_dims: List[int] | None = None, activation: Module | None = None, output_activation: Module | None = None, *args: Any, **kwargs: Any)[source]
Bases:
BaseModelMulti-Layer Perceptron (MLP) Decoder for communication systems.
This module implements a simple MLP-based decoder that maps received signals back to their corresponding messages.
Methods
Initialize the MLPDecoder.
Forward pass of the MLPDecoder.
Examples using
kaira.models.components.MLPDecoder
Sequential Model for Modular Neural Network Design
Sequential Model for Modular Neural Network Design- __init__(in_features: int, out_features: int, hidden_dims: List[int] | None = None, activation: Module | None = None, output_activation: Module | None = None, *args: Any, **kwargs: Any)[source]
Initialize the MLPDecoder.
- Parameters:
in_features (int) – The dimensionality of the input received signals.
out_features (int) – The dimensionality of the output decoded messages.
hidden_dims (List[int], optional) – Dimensions of hidden layers. If None, a single hidden layer with (in_features + out_features) // 2 units is used.
activation (nn.Module, optional) – Activation function to use between layers. If None, ReLU is used.
output_activation (nn.Module, optional) – Activation function to use at the output. If None, no activation is applied to the output.
*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]
Forward pass of the MLPDecoder.
- Parameters:
x (torch.Tensor) – Input tensor of shape (batch_size, in_features).
*args – Additional positional arguments (unused).
**kwargs – Additional keyword arguments (unused).
- Returns:
Output tensor of shape (batch_size, out_features).
- Return type: