CNN model

We will start by using a not-so-deep convolutional neural network to develop an image classification model. We will use the following code for this:

# Model architecturemodel <- keras_model_sequential()model %>%   layer_conv_2d(filters = 32, kernel_size = c(3,3), activation = 'relu',                 input_shape = c(224,224,3)) %>%     layer_conv_2d(filters = 32, kernel_size = c(3,3), activation = 'relu') %>%    layer_max_pooling_2d(pool_size = c(2,2)) %>%   layer_dropout(rate = 0.25) %>%     layer_flatten() %>%   layer_dense(units = 256, activation = 'relu') %>%    layer_dropout(rate = 0.25) %>%   layer_dense(units = 10, activation = 'softmax') summary(model)_________________________________________________________________________Layer (type) Output Shape Param ...

Get Advanced Deep Learning with R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.