In this section, we fine-tune the previous classification model to explore its functions and see whether its performance can be further improved.
Performance optimization tips and best practices
Experimenting with an additional hidden layer
In this experiment, we will add an additional hidden layer to the previous model. The code and output of the summary of the model is given as follows:
# Model architecture
model <- keras_model_sequential()
model %>%
layer_dense(units = 8, activation = 'relu', input_shape = c(21)) %>%
layer_dense(units = 5, activation = 'relu') %>%
layer_dense(units = 3, activation = 'softmax')
summary(model)
OUTPUT
___________________________________________________________________________...