After developing the model architecture, we can compile the model using the following code:
# Compile model
model %>% compile(loss = 'categorical_crossentropy',
optimizer = 'adam',
metrics = 'accuracy')
We compile the model by using categorical_crossentropy for loss, since we are doing multiclass classification. We have specified adam and accuracy for the optimizer and metrics, respectively.