For compiling the model, we will use the following code:
# Compile model
model %>% compile(optimizer = "adam",
loss = "categorical_crossentropy",
metrics = c("acc"))
Here, we've specified the adam optimizer. We're using categorical_crossentropy as the loss function since the labels are based on 50 authors. For the metrics, we've specified the accuracy of the author's classification.
Now that the model has been compiled, it's ready for training.