kaira.models.DeepJSCCModel

Inheritance diagram for DeepJSCCModel
- class kaira.models.DeepJSCCModel(encoder: BaseModel, constraint: BaseConstraint, channel: BaseChannel, decoder: BaseModel, *args: Any, **kwargs: Any)[source]
Bases:
SequentialModelDeep Joint Source-Channel Coding model.
This model implements end-to-end joint source-channel coding using deep neural networks. It consists of: - An encoder that compresses and encodes the source signal - A power constraint that normalizes the encoded signal - A channel that simulates the transmission medium - A decoder that reconstructs the original signal
Key features: - End-to-end differentiable architecture - Automatic adaptation to channel conditions - No separate source/channel coding - Graceful degradation with channel quality - Support for various source types (images, audio, etc.)
Example
>>> # Create a DeepJSCC model for image transmission >>> model = DeepJSCCModel( ... encoder=image_encoder, ... constraint=power_constraint, ... channel=awgn_channel, ... decoder=image_decoder ... ) >>> # Transmit image through noisy channel >>> received = model(image, snr=10.0)
- constraint
Module that applies power constraints to the encoded signal
- Type:
- channel
Simulates the communication channel effects
- Type:
Methods
Initialize the DeepJSCC model.
Add a processing step to the model.
Execute the model sequentially on the input data.
Remove a processing step from the model.
- __init__(encoder: BaseModel, constraint: BaseConstraint, channel: BaseChannel, decoder: BaseModel, *args: Any, **kwargs: Any)[source]
Initialize the DeepJSCC model.
- Parameters:
encoder (BaseModel) – Neural network model for encoding/compressing the input
constraint (BaseConstraint) – Module for applying power constraints to the encoded signal
channel (BaseChannel) – Module simulating the communication channel
decoder (BaseModel) – Neural network model for decoding/reconstructing the input
*args – Variable positional arguments passed to the base class.
**kwargs – Variable keyword arguments passed to the base class.
- add_step(step: Callable) ConfigurableModel
Add a processing step to the model.
- Parameters:
step – A callable that will be added to the processing pipeline. Must accept and return tensor-like objects.
- Returns:
Self for method chaining
- forward(input_data: Any, *args: Any, **kwargs: Any) Any
Execute the model sequentially on the input data.
- Parameters:
input_data – The initial data to process
*args – Additional positional arguments passed to each step.
**kwargs – Additional keyword arguments passed to each step.
- Returns:
The final result after passing through all steps
- remove_step(index: int) ConfigurableModel
Remove a processing step from the model.
- Parameters:
index – The index of the step to remove
- Returns:
Self for method chaining
- Raises:
IndexError – If the index is out of range