kaira.models.FeedbackChannelModel

Inheritance diagram for FeedbackChannelModel
- class kaira.models.FeedbackChannelModel(encoder: BaseModel, forward_channel: BaseChannel, decoder: BaseModel, feedback_generator: BaseModel, feedback_channel: BaseChannel, feedback_processor: BaseModel, max_iterations: int = 1, *args: Any, **kwargs: Any)[source]
Bases:
BaseModelA model that models communication with a feedback channel.
In a feedback channel, the receiver can send information back to the transmitter, allowing the transmitter to adapt its strategy based on feedback. This model models the iterative process of transmission, reception, feedback, and adaptation.
- forward_channel
The channel from transmitter to receiver
- Type:
- feedback_generator
Module that generates feedback at the receiver
- Type:
nn.Module
- feedback_channel
The channel for feedback from receiver to transmitter
- Type:
- feedback_processor
Module that processes feedback at the transmitter
- Type:
nn.Module
Methods
Initialize the feedback channel model.
Process input through the feedback channel system.
- __init__(encoder: BaseModel, forward_channel: BaseChannel, decoder: BaseModel, feedback_generator: BaseModel, feedback_channel: BaseChannel, feedback_processor: BaseModel, max_iterations: int = 1, *args: Any, **kwargs: Any)[source]
Initialize the feedback channel model.
- Parameters:
encoder (BaseModel) – The encoder that processes input data
forward_channel (BaseChannel) – The channel from transmitter to receiver
decoder (BaseModel) – The decoder at the receiver
feedback_generator (BaseModel) – Module that generates feedback signals
feedback_channel (BaseChannel) – The channel for feedback
feedback_processor (BaseModel) – Module that processes feedback at the transmitter
max_iterations (int) – Maximum number of transmission iterations (default: 1)
*args – Variable positional arguments passed to the base class.
**kwargs – Variable keyword arguments passed to the base class.
- forward(input_data: Tensor, *args: Any, **kwargs: Any) Dict[str, Any][source]
Process input through the feedback channel system.
Performs an iterative transmission process where: 1. Transmitter encodes and sends data 2. Receiver decodes and generates feedback 3. Feedback is sent back to the transmitter 4. Transmitter adapts based on feedback 5. Process repeats for the specified number of iterations
- Parameters:
input_data (torch.Tensor) – The input data to transmit
*args – Additional positional arguments passed to internal components.
**kwargs – Additional keyword arguments passed to internal components.
- Returns:
- A dictionary containing:
final_output: The final decoded output (only if at least one iteration)
iterations: List of per-iteration results
feedback_history: History of feedback signals
- Return type:
Dict[str, Any]