Now we've trained our first model.
Congratulations by the way a good idea is to evaluate how it's going.
And of course we can look here.
We can see the accuracy.
It's getting pretty high.
So accuracy 100 percent on the training data set but only about 63 per cent on the validation data set.
It's over fitting but that's a good thing over fitting to begin with.
Means our model is learning something.
But since we've set up a tensor flow callback we can now utilize our logs folder.
So if we go into dog vision and we go to logs so yeah we've got two files there.
This is from I trained our first model yesterday.
So this is where we've got logs from yesterday.
And this is today's model.
So or the one that I've just trained when I had to reset this notebook and so what we're gonna do now
is load up tensor board so that we can check out these log files and see how our models are performing.
Now this is helpful if you're training more than one model.
Of course we can just as I said refer to this.
And then if we ran another model maybe down here if we did model to equals train model we'd get this
output this verbose output is what it's referred to and we could just compare these two cells but that's
not going to really work over the longer term.
So that's what we're all setting ourselves up about.
So let's write a little heading here.
Actually we might do it in this cell.
So we'll go checking
the tensor board logs and the beautiful thing about setting up this like a tensor board callback is
that whenever we train a new model it's going to automatically log its performance.
So let's do it.
All right.
Here we go.
The tensor board magic function percentage sign their tensor board will access we have to pass it the
logs directory but it will access the logs directory we created earlier
and visualize
its contents will turn that into markdown command Ayman collab.
Cell shortcuts are slightly different to Jupiter.
We go to tensor board now.
This is the magic function I was talking about we have to pass it the tag to our log directory.
And if you remember we saved our logs we just saw that we just have to pass the file path to here so
we could copy that.
But remember we're in the habit of typing it out and now because this magic function is as if we're
running it on the command line we're not going to pass it.
The file name the file path as a string we're going to pass it as just non string just as if we are
running this on the command line writing it in terminal.
So if I show you.
Terminal.
So just if we are running a desktop I'll zoom in there see how desktop is an in string format just the
exact same there as I drive my drive and now the trick here is because we've got a space in my drive.
We need to escape it using the backslash.
So my drive.
And then we're going to go forward slash we need dog vision again another spicier dog vision slash logs
so hopefully this should loading to the dog vision logs folder launching tents board.
Yes that's what we're after.
So this is a great tool to help us visualize how our experiments are going
might take a little bit to load for the first time because you're gonna say it's gonna be a fairly graphical
interface check that out.
There we go.
So see here on the left let's just have a look at this interface.
We've got a few options tensor board we've got inactive because this will actually update if we're training
a model we can refresh it if we want if we come down here.
These are the experiments we've run so far.
So there's today.
It's the 5th of February 2020 where I live right now.
I just ran things.
And if we turn off these these are from yesterday we're only going to get two graphs here and one of
them is the validation data sets of the validation performance and the other is the training set.
So the epoch loss.
So these are epochs down here and this is the lost value.
Let's go back up so remember the lost value we're trying to minimize while the accuracy we're trying
to increase so if this epoch accuracy if this is going up that's what we want but you see here how the
training gate is set the one in the red is going up way further almost two to one compared to the validation
data.
That's where we can tell that our machine learning model is over fitting because it's learning the patterns
in the training data far too well so a later experiment would be trying to stop our model how machine
learning model from overfishing so one of the ways we can potentially do that is by using more data.
So we'll try that later on but as we ran more experiments as we keep using our create tensor flow callback
it's going to continually store logs in the logs folder.
And now that way if you find that one machine learning model if we turn these back on if you find that
one one type of model is really outperforming so let's have a look at both of them just on the training
dataset so if we look here they're basically following the same path going down and down that's with
the loss of the loss is going down that's good it means our model is learning something and if we follow
this they're also following the same path here which makes sense because we're using very similar data
as well because we set a random state way back up when we when we split our data we're actually using
quite the same right back out when we created our validation set see how we will use random state.
So both of these experiments are using the same sort of data.
So it makes sense that they get very similar results.
So again you can call this whenever in your notebook whenever you've run an experiment and that way
you can check out okay if I know I ran this experiment here I can see.
All right.
So that model that we ran with these different values here in our create model.
Got a certain results.
And then if we altered this we could see how that changes the results.
So you can start to see over time how this gets more and more valuable at tracking your experiments
and seeing how it does all righty.
So now that we've seen tensor board we've seen how we can track our experiments over time what I believe
our next step is to do is to use our train model to make some predictions.
So let's do that in the next video.