Member-only story

Early Stopping in Practice: an example with Keras and TensorFlow 2.0

A step to step tutorial to add and customize Early Stopping

Robin Chan
Towards Data Science
8 min readJul 28, 2020

--

In this article, we will focus on adding and customizing Early Stopping in our machine learning model and look at an example of how we do this in practice with Keras and TensorFlow 2.0.

Introduction to Early Stopping

In machine learning, early stopping is one of the most widely used regularization techniques to combat the overfitting issue.

Early Stopping monitors the performance of the model for every epoch on a held-out validation set during the training, and terminate the training conditional on the validation performance.

From Hands-on ML [1]

Early Stopping is a very different way to regularize the machine learning model. The way it does is to stop training as soon as the validation error reaches a minimum. The figure below shows a model being trained.

--

--

Towards Data Science
Towards Data Science

Published in Towards Data Science

Your home for data science and AI. The world’s leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.

Robin Chan
Robin Chan

Responses (1)