airpack.tf1.model
¶
Contains neural network models for signal classification implemented in the Tensorflow
1.x framework (using tf.nn
objects).
When getting started with this package, you can use these models asis: the default sizes and parameter values are reasonable for the bundled datasets. Next, you can explore how tuning the values provided as arguments to these models (“model hyperparameters”) affects their performance and accuracy. Finally, these models are each standalone functions, so you can copy them into your own code to add layers, change activation functions, and experiment with different model structures entirely!
Module Contents¶

airpack.tf1.model.
default_network
(x, input_len, output_len, num_filt=None, filt_size=None, pool_size=None, fc_nodes=None)¶ Creates a convolutional signal classifier model for chunks of signal data that are a specified number of samples long.
Required arguments are the input tensor, input length (number of samples in the input), and the number of classes of signal in the classifier output. Other optional arguments are tunable hyperparameters to optimize the model for specific datasets and/or types of signals. When the optional arguments are set to
None
, default values will be used that will work reasonably well.This model object is created with defaultinitialized weights and must be first trained before being used for inference.
Note
Tensorflow models deal with complex input data by taking as input arrays of interleaved I/Q values, then reshaping them into a I/Q channel dimension and a sample number dimension for processing. This can lead to some confusion about what numbers are used for input lengths.
Here’s the relationships you will need to know:
Specify
input_len
as the number of complex samples to process.The actual input buffer passed to training/inference will be realvalued and of size
2 * input_len
.The input buffer is reshaped to a 2D array of size
[2, input_len]
when passed through the neural network.
See also
The
num_filt
,strides
,filt_size
, andpool_size
arguments are tunable hyperparameters that set the shape of convolutional layers within the model.When specifying these sizes, note that these layers operate on 2D inputs of size
[2, N]
, where the first dimension of length two refers to the I vs. Q channel, and the second dimension is the number of samplesinput_len
.Please see the TensorFlow 1.x documentation for the
tf.compat.v1.nn.conv2d
class for more information on 2D convolutional layers in neural networks. Parameters
x (tensorflow.Tensor) – Input tensor of data
input_len (int) – Number of complex samples to be input to the model
num_classes – Number of output classes for this classifier
num_filt (Optional[int]) – Number of output filters in the convolution
strides – Stride within convolutional layers
filt_size (Optional[list]) – Kernel/window size of convolutional layers, typically
[2, X]
for someX
pool_size (Optional[list]) – Kernel/window size of downsampling layers, typically
[1, X]
for someX
fc_nodes (Optional[list]) – List of sizes of fullyconnected (FC) layers
output_len (int) –
 Returns
Signal classifier model object