Creating the second convolution layer
In this recipe, let's create the second convolution layer.
Getting ready
The following are the inputs to the function create_conv_layer
defined in the recipe Using functions to create a new convolution layer.
Input
: This is the four-dimensional output of the first convoluted layer; that is,layer_conv1
Num_input_channels
: This is the number of filters (or depth) in the first convoluted layer,num_filters1
Filter_size
: This is the height and width of the filter layer; namely,filter_size2
Num_filters
: This is the depth of the filter layer,num_filters2
Use_pooling
: This is the binary flag set toTRUE
How to do it...
- Run the
create_conv_layer
function with the preceding input parameters:
# Convolutional Layer 2 conv2 <- create_conv_layer(input=layer_conv1, num_input_channels=num_filters1, filter_size=filter_size2, num_filters=num_filters2, use_pooling=TRUE)
- Extract the layers of the second convolution layer:
layer_conv2 <- conv2$layer conv2_images <- conv2...