Now that you have structured your models using the Keras API, this chapter focuses on the essential steps of training them and assessing their performance. We begin with configuring the learning process through model.compile()
, where you'll select appropriate loss functions (like Mean Squared Error, MSE, for regression or Categorical Crossentropy for classification), choose optimizers (such as Adam or SGD) that guide the learning, and define metrics (like accuracy) to monitor progress.
You will then learn how to feed data to your model and execute the training loop using model.fit()
, understanding parameters like epochs and batch size. Subsequently, we'll cover evaluating the trained model's effectiveness on test data with model.evaluate()
and generating predictions on new inputs using model.predict()
. Finally, we'll introduce Keras Callbacks, including ModelCheckpoint
for saving progress, EarlyStopping
to prevent overfitting, and integrating TensorBoard for visualizing training metrics and model graphs. The chapter concludes with hands-on practice combining these techniques.
4.1 Compiling the Model: Loss Functions
4.2 Compiling the Model: Optimizers
4.3 Compiling the Model: Metrics
4.4 Training with model.fit()
4.5 Evaluating Model Performance with model.evaluate()
4.6 Making Predictions with model.predict()
4.7 Using Callbacks during Training
4.8 Visualizing Training with TensorBoard
4.9 Practice: Training and Monitoring
© 2025 ApX Machine Learning