‫To train our model, we are creating another object model underscore history
‫And we are going to fit our model using X trend and Y Trend data.
‫We want a number of epochs to be 30 and breadth size to be 64.
‫And we also have a validation set in which we have X valid and Y valid datasets.
‫So let's run this.
‫This may take around ten
‫To fifteen minutes
‫Now, as you can see, this will take around ten to fifteen minutes.
‫So if you have a system with low configuration, I recommend you to use five to six epoxie only
‫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 aftereach epoch.
‫It is better to use a list topping 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 two.
‫So around 92 percent accuracy in the last epok.
‫And the validation accuracy of eighty eight percent
‫We can also plot Epoch Ys training and validation accuracy on the plot.
‫So all this accuracy information, along with the epoch value are stored in dark history.
‫So we are going to plot modern history, dot history, on our graph and if you plot it
‫You can see the training loss is decreasing and the validation loss is 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 epox ‫both the training and validation accuracy are going to rise
‫to a certain point.
‫I think it will be better to run it for around 70 or 80 bucks with a lead stopping callback.
‫But for now we will evaluate our model on our test data
‫If you remember, for our ANN model, without any con layer, we were getting accuracy of around
‫86 percent on our test data.
‫So now let's check how our convolutional neural network is performing on our test radio.
‫We will use dot evolution method and we are receiving this value.
‫And another variable that is EV
‫So let's look at the value.
‫You can see the lost value is around zero point three.
‫And we are getting an accuracy of around 88 percent.
‫So as compared to neural network, we are getting around two 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 convolutional layer.
‫If we use multiple convolutional layers and if we run it for a few more Epox, we will definitely
‫get better accuracy on our test dataset.
‫Now, we have already seen how to predict the classes for any new data.
‫The method we are willing to use is predict underscore classes, and then we have to provide a new
‫dataset.
‫As of now, I don't have any new dataset, so I'm just taking up first three object from my test 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 nine, nine stands for the ankle boots and for the
‫second object, the predicted classes to and for the third object.
‫The predictive classes one.
‫Now let's see the actual values we have the actual values in Y test.
‫So if we run this, you can see the predicted values are the same as the actual value
‫You can also look at the image by using plot.
‫I am sure.
‫Just remember to reshape it again from 3d to 2d
‫And after that, you can use plot dot
‫I am show method to plot the object image.
‫And for the first object, the class label was nine, 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 in in classification models, in this model, we just change over and put X and Y shapes.
‫And then we added a convolutional layer and a pulling layer before a word.
‫And then model.
‫That's all for this lecture in the next lecture.
‫We will see a comparison of model with and without willingly.
‫Thank you.