Using functions to create a new convolution layer
Creating a convolution layer is the primary step in a CNN TensorFlow computational graph. This function is primarily used to define the mathematical formulas in the TensorFlow graph, which is later used in actual computation during optimization.
Getting ready
The input dataset is defined and loaded. The create_conv_layer
function presented in the recipe takes the following five input parameters and needs to be defined while setting-up a convolution layer:
Input
: This is a four-dimensional tensor (or a list) that comprises a number of (input) images, the height of each image (here 32L), the width of each image (here 32L), and the number of channels of each image (here 3L : red, blue, and green).Num_input_channels
: This is defined as the number of color channels in the case of the first convolution layer or the number of filter channels in the case of subsequent convolution layers.Filter_size
: This is defined as the width and height of each filter...