All righty.
So we've got a tensor board callback which is going to help us monitor our model's performance as it's
training.
So figuring out if it's learning correctly is it doing well or not.
Now let's create an early stopping callback early stopping helps prevent overfishing.
So our model learning the training data too well by stopping a model when a certain evaluation metric
stops improving.
So if a model trains for too long it can actually do so well at finding patterns in a certain dataset
that it's not able to use those patterns on a nother data set.
So it doesn't generalize well.
So if we come back to our exam if you were to learn the course materials far too well would like you
learnt them off by heart a.k.a. if you're in university and you've studied way too hard on the course
materials you've memorized them off by heart.
When you come to a practice exam or a final exam with questions that you haven't seen before if you've
memorized everything on here instead of just learning the inherent problem solving patterns of the course
materials you're not going to do very well on the practice exam or the final exam.
So you're not going to be able to generalize very well.
And so early stopping helps prevent our model from over fitting the course materials a.k.a. the training
set.
So don't when it comes to a data set that our model hasn't seen before it's able to perform well let's
say it and action will create an early stopping callback.
We'll go here like this early stopping the callback and we'll change that to markdown.
Wonderful.
And so if we go up here we could go tensor flow carers barely stopping callback and this should take
us to the documentation.
There we go.
Be stopping so that's what you can check out there.
Stop training when a monitored quantity has stopped improving let's do that might just link this in
here why not
beautiful and we'll write a little note here early stopping helps stop our model from over feeding by
stopping training if a certain evaluation metric stops improving
so it is set up early stopping is pretty simple so we'll go create a stopping callback and we'll go
early stopping.
TMF carers callbacks and early stopping.
Wonderful.
And we wanted to monitor.
So this is the parameters we pass it to by default.
It monitors the validation loss.
So we're going to see this in a second when we run a model but we might choose validation accuracy.
And now you could choose validation loss if you want but we're gonna choose validation accuracy and
we're gonna give it a patient's value of three.
What is patient's number of epochs with no improvement.
After which training will be stopped.
What's an epoch.
Well let's figure that out in the next video I think.
So we just run this.
These are gonna make these callbacks as well as this model function.
I'm gonna make a lot more sense once we start training a model.
So that's our early stopping callback ready.
We're going to monitor the validation accuracy as soon as it stops improving for three epochs.
We're gonna stop training our model.
So in the next couple of videos what we might do is I think we are definitely well and truly ready to
start training a model.
So if we come back to our keynote what we're focused on we've picked a model from tensor flow to suit
our tensor flow hub to suit our problem.
We've turned our data into tenses.
Now it's time to fit a model to the training data and make a prediction.
So how about we make a function for training a model.