There's more...

Note that we can identify when the model starts overfitting on the training data by viewing the loss function on the test and train sets. We can also see that the train set loss is not as smooth as that in the test set. This is because of two reasons: the first is that we are using a smaller batch size than the test set, although not by much; the second cause is due to the fact that we are training on the train set and the test set does not impact the variables of the model.

Get TensorFlow Machine Learning Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.