Contains neural network models for signal classification implemented in the Tensorflow
1.x framework (using
When getting started with this package, you can use these models as-is: 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!
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 default-initialized weights and must be first trained before being used for inference.
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:
input_lenas the number of complex samples to process.
The actual input buffer passed to training/inference will be real-valued and of size
2 * input_len.
The input buffer is reshaped to a 2-D array of size
[2, input_len]when passed through the neural network.
pool_sizearguments are tunable hyperparameters that set the shape of convolutional layers within the model.
When specifying these sizes, note that these layers operate on 2-D 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 samples
Please see the TensorFlow 1.x documentation for the
tf.compat.v1.nn.conv2dclass for more information on 2-D convolutional layers in neural networks.
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 some
pool_size (Optional[list]) – Kernel/window size of downsampling layers, typically
[1, X]for some
fc_nodes (Optional[list]) – List of sizes of fully-connected (FC) layers
output_len (int) –
Signal classifier model object