To train our model we are creating another object model underscored history and we are going to fit
our model using extraneous environ data.
We want a number of epochs to be totally and bed size to be 64 and we also have a validation set in
which we have X valid and five valid datasets.
So let's run this.
This may take our own 10 to 15 minutes.
Now as you can see this will take around 10 to 15 minutes.
So if you have a system with low configuration I recommend you to use five to six epochs on Lee
here.
You can also see we are getting training loss training accuracy validation loss and validation accuracy
and you can notice that I have not used any callbacks but it is recommended to use callbacks to save
the model.
After each epoch it is better to use a less stopping callback before running this model.
So our training is going to complete.
You can see on our train set we have the accuracy score of zero point nine do so around 92 percent accuracy
in the last people and the validation accuracy of 88 percent.
We can also plot epoch why is training and validation accuracy on the plot.
So all this accuracy information along with the e-book where you are is stored in dark history.
So we are going to plot model history gold history on our graph and if you plotted
you can see the training losses decreasing and the validation losses also decreasing and both validation
accuracy and training accuracy are increasing
You can also identify that the model has still not converged.
And if we run it for a few more epochs both the training and validation accuracy are going to rise to
a certain point.
I think it will be better to run it for our own 70 or 80 bucks with a lead stopping callback
what for now.
We will evaluate our model on our test data.
If you remember fought over in and model without any conflict we were getting accuracy of around 86
percent on our test data.
So now let's check how our convolution all neural network is performing on our radar.
We will use the alert method and we are receiving this value add another variable that is easy.
So let's look at the value you can see the lost value is around zero point three and we are getting
and the accuracy of around 88 percent
so as compared to neural network we are getting around 2 percent increase in the accuracy on our test
dataset using CNN model.
And another thing to notice is that we have just used a single constitutional layer.
If we use multiple convolution layers and if we run it for a few more e-books we will definitely get
better accuracy on our test data dataset.
Now we have already seen how to predict the classes for any new data the method we are going to use
is predict under the school classes and then we have to provide a new dataset.
As of now I don't have any new dataset so I am just taking up first three objects from my dad's dataset
and then we are going to restore the predicted class in widespread variable and we are returning it.
So for the first object the predicted class label is 9 9 percent for ankle boots and for the second
object.
The predicted classes 2 and 4 the third object the predictive classes 1.
Now let's see the actual values.
We have the actual values in wide test.
So if we run this you can see the predicted values are the same as the actual values.
You can also look at the image by using blood.
I am sure Just remember to reshape it again from three to two to read.
And after that you can use block Dot.
I am sure method to plot the object image and for the first object the class label was name which is
ankle boots and in the image also we can see that the image looks like of an ankle boot so all these
steps are similar.
What we did for Indian classification models in this model we just change over and put X and Y shapes
and then we added a constitutional layer and the pooling layer before a word and then more than
that's all for this lecture in the next lecture we will see a comparison of the model with and without
willingly.
Thank you.