1
00:00:02,450 --> 00:00:04,050
Well welcome back.

2
00:00:04,060 --> 00:00:08,940
So let's test out our Morty lay out neural network model when one copy this.

3
00:00:09,190 --> 00:00:16,750
I'm gonna come down here and then the first comment is X which is the same as what we had you know what

4
00:00:16,750 --> 00:00:21,500
to lay a neural network so paste this over here the next year's day.

5
00:00:21,500 --> 00:00:22,320
Train y

6
00:00:25,410 --> 00:00:27,560
pace this over here like this.

7
00:00:27,600 --> 00:00:35,200
The argument of the that the third argument is the estimations which we created over here.

8
00:00:35,220 --> 00:00:37,010
Copy this positive here.

9
00:00:38,760 --> 00:00:38,960
Yeah.

10
00:00:38,990 --> 00:00:40,550
You went up to that.

11
00:00:42,070 --> 00:00:43,020
Yes.

12
00:00:44,360 --> 00:00:45,390
Its lending rate

13
00:00:50,420 --> 00:00:55,280
or we can keep the default lending rate and I'm simply going to set a number of iterations to the same

14
00:00:55,280 --> 00:01:00,550
number of iterations we used you know to lay a neural network example.

15
00:01:00,590 --> 00:01:07,510
So I'm going to copy this and then I'm going to paste it over here.

16
00:01:09,890 --> 00:01:10,270
Okay.

17
00:01:10,310 --> 00:01:19,400
And I'm going to store the return parameters in a variable called parameters and then I'm going to bring

18
00:01:19,400 --> 00:01:24,640
this bit that would comment it is the same thing.

19
00:01:24,670 --> 00:01:29,600
So I'm going to copy this then paste it over here and then on comments

20
00:01:33,090 --> 00:01:35,240
right.

21
00:01:35,440 --> 00:01:36,060
Um

22
00:01:39,390 --> 00:01:42,350
we can we can test this out.

23
00:01:42,480 --> 00:01:47,990
Let's see we can test the one by one 0 comment this out the bit that we tested with our own image.

24
00:01:48,000 --> 00:01:49,080
We can do that later.

25
00:01:49,200 --> 00:01:51,530
Let's see what are we have some arrows first.

26
00:01:51,660 --> 00:01:53,280
A comment is out.

27
00:01:53,280 --> 00:01:59,380
So we simply going to run our multilayer and then and then um Yeah let's see.

28
00:01:59,900 --> 00:02:01,220
Control as to save.

29
00:02:01,260 --> 00:02:03,160
Click over here run model.

30
00:02:04,770 --> 00:02:05,170
Okay.

31
00:02:05,190 --> 00:02:12,510
We have an arrow because we failed to say we are using the deplaning library version to cause we import

32
00:02:12,510 --> 00:02:13,200
in the library.

33
00:02:13,200 --> 00:02:15,120
So we've got a change.

34
00:02:15,120 --> 00:02:16,740
We created a new one called V2.

35
00:02:16,770 --> 00:02:18,030
So this has to be V2.

36
00:02:18,060 --> 00:02:19,960
I'm gonna fix this over here.

37
00:02:20,070 --> 00:02:21,150
Let's put it again and see

38
00:02:28,440 --> 00:02:29,550
click over here to run

39
00:02:40,510 --> 00:02:46,750
um we have a typo over here in our library line eleven.

40
00:02:47,110 --> 00:02:50,010
I put an underscore here by mistake.

41
00:02:50,440 --> 00:02:51,310
Oh just fix the

42
00:02:55,950 --> 00:03:00,870
yes the typo should be a plus over here control esta safe.

43
00:03:00,920 --> 00:03:01,460
Okay.

44
00:03:01,460 --> 00:03:05,850
So I run my model again after I fixed the arrow click over here.

45
00:03:07,130 --> 00:03:07,430
Okay.

46
00:03:07,430 --> 00:03:07,880
Good.

47
00:03:07,880 --> 00:03:10,520
It's training now.

48
00:03:10,790 --> 00:03:11,680
Okay.

49
00:03:11,870 --> 00:03:13,400
The arrow is reducing

50
00:03:17,150 --> 00:03:18,760
okay.

51
00:03:19,750 --> 00:03:23,410
We selected two thousand five hundred iterations.

52
00:03:23,410 --> 00:03:26,040
We are almost there.

53
00:03:26,040 --> 00:03:28,070
And the arrow has reduced drastically.

54
00:03:28,090 --> 00:03:29,190
So that's the curve.

55
00:03:29,200 --> 00:03:31,460
It looks better than the one we saw with the.

56
00:03:31,960 --> 00:03:34,300
Ready to lay a neural network the arrow.

57
00:03:34,360 --> 00:03:37,580
We ended up with zero point zero two three six.

58
00:03:37,600 --> 00:03:37,850
Okay.

59
00:03:37,860 --> 00:03:39,610
This does it.

60
00:03:39,610 --> 00:03:44,580
And as you can see this is seventy six percent accuracy for our test set.

61
00:03:44,710 --> 00:03:48,140
Our training set is almost 100 percent.

62
00:03:48,160 --> 00:03:49,770
And this is true too.

63
00:03:49,810 --> 00:03:55,580
This could be due to over fitting something or someone else over fitting which we should look at later.

64
00:03:55,760 --> 00:04:02,260
Um but yeah you can see the improvement here and you can actually play with the hyper parameters we

65
00:04:02,260 --> 00:04:02,680
are trying.

66
00:04:02,680 --> 00:04:05,230
Just uh finally a neural network here.

67
00:04:05,230 --> 00:04:10,940
And finally uh we've decided on a particular number of nodes.

68
00:04:11,080 --> 00:04:16,450
So you have so many hyper parameters that you can change you can change the number of nodes pair layer

69
00:04:16,870 --> 00:04:22,630
you can change the number of layers you want you can change the learning rate you can change a number

70
00:04:22,630 --> 00:04:31,060
of iterations etc. so you can play with that and see how how how far you can get the accuracy.

71
00:04:31,060 --> 00:04:31,870
Okay.

72
00:04:31,960 --> 00:04:36,550
So now um we front a prediction.

73
00:04:36,610 --> 00:04:37,480
Let's see.

74
00:04:37,750 --> 00:04:44,610
We can test the further like we did earlier this is the file for a while.

75
00:04:44,980 --> 00:04:46,330
That was the file for library.

76
00:04:46,330 --> 00:04:48,820
This is our file.

77
00:04:49,730 --> 00:04:58,720
Next what are we going to do is show the wrong predictions like we did earlier how uncommon this bit

78
00:05:02,640 --> 00:05:12,290
control is and then going to run tomorrow.

79
00:05:12,750 --> 00:05:13,860
It's almost complete

80
00:05:18,890 --> 00:05:20,270
okay.

81
00:05:22,390 --> 00:05:24,960
Um these are the wrong ones.

82
00:05:25,330 --> 00:05:33,670
Okay so we mistook this for a cut the second one we saw an actual cut and we weren't able to predict

83
00:05:33,670 --> 00:05:34,510
it.

84
00:05:34,750 --> 00:05:39,730
And these ones where you have the cuts blending into the background it's it's very difficult for the

85
00:05:40,450 --> 00:05:45,050
new network at this stage to be able to accurately predict those.

86
00:05:45,090 --> 00:05:50,590
So these are the the wrong ones that we got we mistook this for a cut with mistook this for a cut as

87
00:05:50,590 --> 00:05:53,530
well and we weren't able to predict the cuts here.

88
00:05:53,640 --> 00:05:54,030
Right.

89
00:05:54,040 --> 00:05:58,230
Let's try with our image.

90
00:05:58,420 --> 00:06:00,280
I'm gonna come over here or come in this

91
00:06:04,300 --> 00:06:05,450
comment.

92
00:06:05,710 --> 00:06:13,360
I'm going to comment this block and this is image number six.

93
00:06:13,360 --> 00:06:14,890
It's in our images folder.

94
00:06:14,890 --> 00:06:16,430
It's not a cut.

95
00:06:16,720 --> 00:06:18,770
Let's see number six.

96
00:06:18,790 --> 00:06:20,620
Number six is this bird over here.

97
00:06:20,680 --> 00:06:23,860
Let's see what prediction we get for it.

98
00:06:23,860 --> 00:06:27,780
So we predicted this if it's a cat we should see one if it is.

99
00:06:28,090 --> 00:06:30,650
If it's not a cat we should see zero.

100
00:06:30,670 --> 00:06:36,000
I'm going to click over here run module okay.

101
00:06:36,040 --> 00:06:36,820
It started

102
00:06:40,310 --> 00:06:42,260
okay.

103
00:06:42,650 --> 00:06:50,590
And um so it's predicted this us not a cat so accuracy is one that is good.

104
00:06:50,600 --> 00:06:51,000
Okay.

105
00:06:51,110 --> 00:06:54,800
So I advise you to try with the other images we have.

106
00:06:54,800 --> 00:06:55,200
You know what.

107
00:06:55,220 --> 00:07:00,740
You may just fold up and also go to the Internet and download other images and pass it through the neural

108
00:07:00,780 --> 00:07:03,970
network and see what prediction we get.

109
00:07:03,980 --> 00:07:10,760
This one has an accuracy of 76 percent as we've seen but this can be improved if you are able to find

110
00:07:10,790 --> 00:07:16,670
the right configuration meaning the right number of layers and the right number of nodes spare layer

111
00:07:16,910 --> 00:07:23,540
the right amount of training time the lending rates et cetera you can get it perhaps up to 80 percent

112
00:07:24,230 --> 00:07:31,640
but later on we shall see convolution or neural networks and the best suited for this type of task and

113
00:07:31,640 --> 00:07:36,080
also you should keep in mind we've trained our model with an extremely small amount of data.

114
00:07:36,740 --> 00:07:40,840
Yeah we had about 200 I think to 100 training examples.

115
00:07:40,850 --> 00:07:43,580
That's too small for this type of task.

116
00:07:44,090 --> 00:07:49,550
But yeah I think yeah you can experiment with it further if you have any questions just send me a message

117
00:07:49,550 --> 00:07:56,060
and if you've got any suggestions as well you can always message me and I'll see you in the next lesson.

118
00:07:56,060 --> 00:07:56,780
Have a nice day.
