Creating the first convolution layer
In this recipe, let's create the first 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 a four-dimensional reshaped input placeholder variable:x_imageNum_input_channels: This is the number of color channels, namelynum_channelsFilter_size: This is the height and width of the filter layerfilter_size1Num_filters: This is the depth of the filter layer, namelynum_filters1Use_pooling: This is the binary flag set toTRUE
How to do it...
- Run the
create_conv_layerfunction with the preceding input parameters:
# Convolutional Layer 1 conv1 <- create_conv_layer(input=x_image, num_input_channels=num_channels, filter_size=filter_size1, num_filters=num_filters1, use_pooling=TRUE)
- Extract the
layersof the first convolution layer:
layer_conv1 <- conv1$layer conv1_images <- conv1$layer$eval(feed_dict = dict(x = train_data$images...