Decoder model

For the decoder model, the first three convolutional layers have 256, 512, and 512, filters, as shown in the following code:

# Decoder network
decoder <- encoder %>%
layer_conv_2d(filters = 256, kernel_size = c(3,3), activation = 'relu',padding = 'same') %>%
layer_upsampling_2d(c(2,2)) %>%
layer_conv_2d(filters = 512, kernel_size = c(3,3), activation = 'relu',padding = 'same') %>%
layer_upsampling_2d(c(2,2)) %>%
layer_conv_2d(filters = 512, kernel_size = c(3,3), activation = 'relu',padding = 'same') %>%
layer_upsampling_2d(c(2,2)) %>%
layer_conv_2d(filters = 3, kernel_size = c(3,3), activation = 'sigmoid',padding = 'same')
summary(decoder)
Output
Tensor("conv2d_46/Sigmoid:0", shape=(?, 128, 128, 3), dtype=float32)

Here, we used upsampling layers. In the last convolutional layer, we made use of a sigmoid activation function. In the last convolutional layer, we used three filters since we are making use of color images. Finally, the output of the decoder model has 128 x 128 x 3 dimensions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset