﻿1
00:00:00,750 --> 00:00:04,770
‫In the last we knew we trained our model.

2
00:00:04,920 --> 00:00:09,450
‫This is what happened at each epoch.

3
00:00:09,550 --> 00:00:18,560
‫We got accuracy and loss and this was for book training sir and the validation.

4
00:00:19,710 --> 00:00:21,630
‫This was also uploaded on the right hand side.

5
00:00:22,380 --> 00:00:27,010
‫You can see in this graph this top graph is both lost.

6
00:00:27,120 --> 00:00:35,020
‫It has blue line for loss on the training set and the Green Line for validation loss.

7
00:00:35,130 --> 00:00:38,790
‫The graph on the bottom is for accuracy.

8
00:00:38,790 --> 00:00:45,590
‫This blue line is for training accuracy and the Green Line is part of validation accuracy.

9
00:00:45,780 --> 00:00:55,050
‫You can see that after 15th epoch there is not much improvement in the accuracy.

10
00:00:55,050 --> 00:01:01,410
‫However we have still run this program for 30 epochs now.

11
00:01:01,430 --> 00:01:09,410
‫As I said in the beginning the real performance of a model is gauged on previously unseen data.

12
00:01:09,410 --> 00:01:15,460
‫This is the reason we kept a set of 10000 observations separately.

13
00:01:15,740 --> 00:01:23,990
‫So now we can predict class for these test images and compare accuracy against the actual class of those

14
00:01:24,050 --> 00:01:24,560
‫images

15
00:01:27,220 --> 00:01:36,010
‫just know that the training accuracy that we have achieved is nearly 87 percent.

16
00:01:36,010 --> 00:01:45,700
‫Now we are going to see if there is different accuracy achieved on these test say now when we are looking

17
00:01:45,700 --> 00:01:54,580
‫at test set performance instead of just giving the test images and getting the predicted values we can

18
00:01:54,580 --> 00:02:01,180
‫give both images and the actual labels this way.

19
00:02:01,180 --> 00:02:08,860
‫Using this evaluate function our model can straightaway evaluate and show us the error and accuracy

20
00:02:08,980 --> 00:02:20,150
‫of our model on the classic so I store the result of this evaluate function in the score variable thus

21
00:02:20,230 --> 00:02:26,740
‫evaluate takes two parameters as images and gets labeled.

22
00:02:26,920 --> 00:02:34,630
‫It uses the model to predict on test images and compares the predicted label against these test labels.

23
00:02:34,630 --> 00:02:35,710
‫So let's run the score

24
00:02:42,820 --> 00:02:49,930
‫now if you want to see the test loss and test accuracy you can find these two lines of code.

25
00:02:54,300 --> 00:03:04,140
‫You can see that the loss on test set is due to point forward one that as on training say it was zero

26
00:03:04,140 --> 00:03:13,420
‫point thirty seven and the accuracy on base it is nearly 85 percent whereas it was 87 percent on the

27
00:03:13,430 --> 00:03:23,310
‫training say this means that there is a little bit of overheating but the lot talk about that in detail

28
00:03:23,310 --> 00:03:25,850
‫here.

29
00:03:26,320 --> 00:03:34,120
‫Now if you are interested in actual predictions of the classes on the test said we can use to predict

30
00:03:34,120 --> 00:03:38,810
‫function and just and predict test images.

31
00:03:38,900 --> 00:03:43,830
‫So this is the predict function and it just takes the input of test images.

32
00:03:43,870 --> 00:03:46,560
‫We do not need to give the test labels.

33
00:03:47,350 --> 00:03:49,360
‫When we get past images.

34
00:03:49,540 --> 00:03:54,430
‫It applies the model on it and gives us the predictions.

35
00:03:54,430 --> 00:04:04,810
‫Next on the score you can see that we have predictions on our 10000 best images and it has 10 values

36
00:04:04,840 --> 00:04:08,100
‫corresponding to each prediction.

37
00:04:08,110 --> 00:04:10,620
‫Let's look at those 10 values forty first image.

38
00:04:10,640 --> 00:04:11,370
‫Indeed basic

39
00:04:14,410 --> 00:04:20,440
‫since we used an output variables that does not match function.

40
00:04:20,620 --> 00:04:26,960
‫If you look at the first set of predictions this is a set of probabilities.

41
00:04:27,160 --> 00:04:36,760
‫This is the probability of the first test image belonging to the first class.

42
00:04:36,760 --> 00:04:44,980
‫This is the probability for the second class and so on to find out which of these probabilities is the

43
00:04:44,980 --> 00:04:45,940
‫largest.

44
00:04:46,000 --> 00:04:55,000
‫So that we can assign that class to that image we use these which taught max function.

45
00:04:55,000 --> 00:05:02,020
‫You can see here which dot Max and we input the predictions very well.

46
00:05:06,310 --> 00:05:15,110
‫When I've done this it tells me that the end value which is the seven point six six independents to

47
00:05:15,110 --> 00:05:21,370
‫1 minus 1 this value is the largest probability.

48
00:05:21,440 --> 00:05:32,630
‫So we want to assign the tenth class to this image now to find out what is the class associated with

49
00:05:32,630 --> 00:05:34,720
‫this tenth position.

50
00:05:34,910 --> 00:05:42,830
‫If you remember we created a class name array which tore the names of the classes.

51
00:05:43,040 --> 00:05:43,940
‫Here is that edit.

52
00:05:45,650 --> 00:05:50,600
‫So we want to find out the end element of the story.

53
00:05:50,930 --> 00:05:55,520
‫We just input that entire which max function to this class memory.

54
00:05:57,020 --> 00:06:02,780
‫So basically this which Max will return the position and corresponding to that position we find out

55
00:06:02,780 --> 00:06:04,690
‫the last name from this.

56
00:06:05,480 --> 00:06:15,620
‫So when we run this it tells us that the class is ankle boot so basically our prediction is that the

57
00:06:15,620 --> 00:06:26,000
‫first image in the SCA is of ankle boot if you want to check takes a look at that image we will again

58
00:06:26,000 --> 00:06:30,490
‫use the plot function and we'll plot this first image of basic.

59
00:06:32,660 --> 00:06:36,870
‫So when we plot this image you can have a look at this image.

60
00:06:36,950 --> 00:06:43,290
‫This looks like an angled wood and which is also our prediction that it is an ankle boot.

61
00:06:43,490 --> 00:06:46,490
‫So this looks correct.

62
00:06:46,650 --> 00:06:53,210
‫Now lastly instead of predicting probabilities you can straightaway predict the glasses also using the

63
00:06:53,210 --> 00:06:54,770
‫predict glasses function

64
00:06:57,680 --> 00:07:06,260
‫here's how we do that we create a new variable called Glass bread and this gets the information of all

65
00:07:06,260 --> 00:07:09,460
‫the predicted classes on the best images.

66
00:07:09,470 --> 00:07:18,500
‫This function also gets only one parameter that is the input best images and we run this and we look

67
00:07:18,500 --> 00:07:26,730
‫at the first 20 predictions you can see that for the first image we are predicting ninth plus.

68
00:07:27,020 --> 00:07:30,480
‫So you maintain that earlier we predicted then glass why is.

69
00:07:30,620 --> 00:07:36,110
‫Now we're looking nine so this tent is the position of the glass label.

70
00:07:37,060 --> 00:07:43,910
‫So paint glass is actually labeled nine because glass labels are starting from zero.

71
00:07:45,230 --> 00:07:50,910
‫So both of these represent the same thing night label label.

72
00:07:50,950 --> 00:07:52,910
‫Glass is ankle boot only.

73
00:07:54,950 --> 00:07:56,940
‫So these are all the glass predictions.

74
00:07:58,210 --> 00:07:59,750
‫So we have both the method.

75
00:07:59,750 --> 00:08:05,220
‫One is to predict the probabilities use those predicted probabilities.

76
00:08:05,270 --> 00:08:12,700
‫Find out the maximum out of those that glass having the maximum probability will be the predicted plus

77
00:08:13,060 --> 00:08:21,620
‫all you can straightaway you do predict losses function to get the predicted glass on the new set.

78
00:08:21,770 --> 00:08:23,460
‫That's all in this we do.

79
00:08:23,570 --> 00:08:29,900
‫So we have created a complete neural network classification model.

80
00:08:29,900 --> 00:08:39,200
‫So here's a summary of whatever we did to bring this classification model we install a US package and

81
00:08:39,200 --> 00:08:44,030
‫we activated it using install underscore gave us we installed it.

82
00:08:44,030 --> 00:08:49,060
‫Get us go get us liability and enter look.

83
00:08:49,630 --> 00:09:00,460
‫We then imported the data we pre processed it and normalized it using that data it was in two parts

84
00:09:00,770 --> 00:09:10,060
‫it had a train part and a test part we used to train part to bring our model then we were defining our

85
00:09:10,060 --> 00:09:10,700
‫model.

86
00:09:10,810 --> 00:09:12,300
‫We had three parts.

87
00:09:12,310 --> 00:09:15,590
‫One was to give the structure of the model.

88
00:09:15,640 --> 00:09:22,730
‫The second was configuring the learning process and the third was then inadequate function to bring

89
00:09:22,720 --> 00:09:23,910
‫the model.

90
00:09:24,120 --> 00:09:31,780
‫Once our model was trained rejig its performance on the basic and we found out that our model is giving

91
00:09:31,780 --> 00:09:37,070
‫all the performance of 85 percent which would satisfy.

92
00:09:37,930 --> 00:09:45,520
‫So following this entire process we have created a classification model using neural networks.

