‫In the last we knew we trained our model.
‫This is what happened at each epoch.
‫We got accuracy and loss and this was for book training sir and the validation.
‫This was also uploaded on the right hand side.
‫You can see in this graph this top graph is both lost.
‫It has blue line for loss on the training set and the Green Line for validation loss.
‫The graph on the bottom is for accuracy.
‫This blue line is for training accuracy and the Green Line is part of validation accuracy.
‫You can see that after 15th epoch there is not much improvement in the accuracy.
‫However we have still run this program for 30 epochs now.
‫As I said in the beginning the real performance of a model is gauged on previously unseen data.
‫This is the reason we kept a set of 10000 observations separately.
‫So now we can predict class for these test images and compare accuracy against the actual class of those
‫images
‫just know that the training accuracy that we have achieved is nearly 87 percent.
‫Now we are going to see if there is different accuracy achieved on these test say now when we are looking
‫at test set performance instead of just giving the test images and getting the predicted values we can
‫give both images and the actual labels this way.
‫Using this evaluate function our model can straightaway evaluate and show us the error and accuracy
‫of our model on the classic so I store the result of this evaluate function in the score variable thus
‫evaluate takes two parameters as images and gets labeled.
‫It uses the model to predict on test images and compares the predicted label against these test labels.
‫So let's run the score
‫now if you want to see the test loss and test accuracy you can find these two lines of code.
‫You can see that the loss on test set is due to point forward one that as on training say it was zero
‫point thirty seven and the accuracy on base it is nearly 85 percent whereas it was 87 percent on the
‫training say this means that there is a little bit of overheating but the lot talk about that in detail
‫here.
‫Now if you are interested in actual predictions of the classes on the test said we can use to predict
‫function and just and predict test images.
‫So this is the predict function and it just takes the input of test images.
‫We do not need to give the test labels.
‫When we get past images.
‫It applies the model on it and gives us the predictions.
‫Next on the score you can see that we have predictions on our 10000 best images and it has 10 values
‫corresponding to each prediction.
‫Let's look at those 10 values forty first image.
‫Indeed basic
‫since we used an output variables that does not match function.
‫If you look at the first set of predictions this is a set of probabilities.
‫This is the probability of the first test image belonging to the first class.
‫This is the probability for the second class and so on to find out which of these probabilities is the
‫largest.
‫So that we can assign that class to that image we use these which taught max function.
‫You can see here which dot Max and we input the predictions very well.
‫When I've done this it tells me that the end value which is the seven point six six independents to
‫1 minus 1 this value is the largest probability.
‫So we want to assign the tenth class to this image now to find out what is the class associated with
‫this tenth position.
‫If you remember we created a class name array which tore the names of the classes.
‫Here is that edit.
‫So we want to find out the end element of the story.
‫We just input that entire which max function to this class memory.
‫So basically this which Max will return the position and corresponding to that position we find out
‫the last name from this.
‫So when we run this it tells us that the class is ankle boot so basically our prediction is that the
‫first image in the SCA is of ankle boot if you want to check takes a look at that image we will again
‫use the plot function and we'll plot this first image of basic.
‫So when we plot this image you can have a look at this image.
‫This looks like an angled wood and which is also our prediction that it is an ankle boot.
‫So this looks correct.
‫Now lastly instead of predicting probabilities you can straightaway predict the glasses also using the
‫predict glasses function
‫here's how we do that we create a new variable called Glass bread and this gets the information of all
‫the predicted classes on the best images.
‫This function also gets only one parameter that is the input best images and we run this and we look
‫at the first 20 predictions you can see that for the first image we are predicting ninth plus.
‫So you maintain that earlier we predicted then glass why is.
‫Now we're looking nine so this tent is the position of the glass label.
‫So paint glass is actually labeled nine because glass labels are starting from zero.
‫So both of these represent the same thing night label label.
‫Glass is ankle boot only.
‫So these are all the glass predictions.
‫So we have both the method.
‫One is to predict the probabilities use those predicted probabilities.
‫Find out the maximum out of those that glass having the maximum probability will be the predicted plus
‫all you can straightaway you do predict losses function to get the predicted glass on the new set.
‫That's all in this we do.
‫So we have created a complete neural network classification model.
‫So here's a summary of whatever we did to bring this classification model we install a US package and
‫we activated it using install underscore gave us we installed it.
‫Get us go get us liability and enter look.
‫We then imported the data we pre processed it and normalized it using that data it was in two parts
‫it had a train part and a test part we used to train part to bring our model then we were defining our
‫model.
‫We had three parts.
‫One was to give the structure of the model.
‫The second was configuring the learning process and the third was then inadequate function to bring
‫the model.
‫Once our model was trained rejig its performance on the basic and we found out that our model is giving
‫all the performance of 85 percent which would satisfy.
‫So following this entire process we have created a classification model using neural networks.