Before training a Keras model, compile() sets the loss function, optimizer, and metrics used during training. The loss measures model error, the optimizer guides training, and the metrics report how the model is doing. For categorical classification, one example uses categorical cross-entropy, Adam, and accuracy. section 10.3
model.compile(loss = 'categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
This call configures categorical cross-entropy loss, the Adam optimizer, and accuracy reporting. section 10.3
