Example Trainable Algorithms
Example trainable algorithms to get started with.
New users are recommended to use DenseRadio to ensure that input parameters are compatible.
A DenseRadio provides compatible tx and rx methods. When defining transmitters and receivers,
ensure the corresponding method is passed.
DenseRadio
Bases: Module
A convenient wrapper for DenseTransmissionAlgorithm and DenseReceptionAlgorithm.
DenseRadio guarantees that the underlying TransmissionAlgorithm and ReceptionAlgorithm are
compatible. A DenseRadio provides compatible tx and rx methods. When defining transmitters
and receivers, ensure the corresponding method is passed.
Example
__init__(n_input_bits, tx_length_per_bit)
Create a new DenseRadio. See DenseTransmissionAlgorithm.init.
rx(signal)
See DenseReceptionAlgorithm.__call__.
tx(n_timesteps, batch_size=1)
See DenseTransmissionAlgorithm.__call__.
DenseReceptionAlgorithm
Bases: Module
An opinionated ReceptionAlgorithm that uses trainable dense layers.
Do not expect this algorithm to be especially performant. It is an example to help
users get started with training receivers using Torchradio.
__call__(signal)
Apply a series of dense layers an input signal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
signal |
Tensor
|
A 2D complex valued input tensor. |
required |
Returns:
| Type | Description |
|---|---|
Reception
|
A |
__init__(n_bits, window_length)
Create a new DenseReceptionAlgorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_bits |
int
|
An input parameter used to shape the number of parameters in the
dense layers. Should be compatible with the |
required |
window_length |
int
|
An input parameter used cutoff unused bits from
|
required |
DenseTransmissionAlgorithm
Bases: Module
An opinionated TransmissionAlgorithm that uses trainable dense layers.
Do not expect this algorithm to be especially performant. It is an example to help
users get started with training transmitters using Torchradio.
__call__(n_timesteps, batch_size=1)
Apply a series of dense layers to randomly generated bits.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_timesteps |
int
|
How many timesteps to transmit for. |
required |
batch_size |
int
|
How many transmissions to create in parallel. |
1
|
Returns:
| Type | Description |
|---|---|
Transmission
|
A |
__init__(n_input_bits, tx_length_per_bit)
Create a new DenseTranmissionAlgorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_input_bits |
int
|
An input parameter used to shape the number of parameters in the dense layers. |
required |
tx_length_per_bit |
float
|
An input parameter used to shape the number of parameters in the dense layers. |
required |