1
00:00:00,570 --> 00:00:06,840
In order to create our convolutional neural network, we're just going to make use of this sequential

2
00:00:06,840 --> 00:00:12,560
API, which we had built previously, and then we'll define the input layer.

3
00:00:12,570 --> 00:00:18,390
So here we have this input shape to 24 lets we add define in size actually.

4
00:00:18,390 --> 00:00:25,270
So we have M size, that's it by M size by three.

5
00:00:25,290 --> 00:00:29,800
We could also define a number of channels, but let's just let it to be equal to three.

6
00:00:29,880 --> 00:00:36,600
Then from here we have the normal laser and then we have this column to the layer right here.

7
00:00:36,600 --> 00:00:40,020
So we have this arguments which are default.

8
00:00:40,020 --> 00:00:42,890
So we'll then bother to check on this.

9
00:00:42,900 --> 00:00:47,160
We will take this off, take this off, and that's fine.

10
00:00:47,160 --> 00:00:49,230
So we'll have this.

11
00:00:49,680 --> 00:00:50,580
There we go.

12
00:00:50,580 --> 00:00:58,980
We have our come to DX will come to D which we copy or rather we cut that off and then we put this after

13
00:00:58,980 --> 00:01:01,440
the input layer right here.

14
00:01:01,440 --> 00:01:03,900
So there we go, We have our input layer.

15
00:01:03,900 --> 00:01:08,790
We want six filters and then we can size of five.

16
00:01:09,270 --> 00:01:10,320
So that's it.

17
00:01:10,320 --> 00:01:13,530
Our stride, we could take this to be equal one.

18
00:01:13,830 --> 00:01:14,880
There we go.

19
00:01:14,880 --> 00:01:18,840
Pattern is valid, so that's what we expect.

20
00:01:18,840 --> 00:01:22,530
And then just here we have our activation.

21
00:01:22,530 --> 00:01:29,760
So we have activation, we could see sigmoid, we have the sigmoid activation since we're replicating

22
00:01:30,300 --> 00:01:33,600
the rail loop or rather the net architecture.

23
00:01:33,600 --> 00:01:39,960
So there we go, we have the sigmoid and that's our come to D from the continuity.

24
00:01:39,960 --> 00:01:41,550
We have a max pooling layer.

25
00:01:41,550 --> 00:01:46,410
Let's take this off, let's take this dense layers off from this curve to D, We have the max pull and

26
00:01:46,410 --> 00:01:46,890
layer.

27
00:01:46,920 --> 00:01:50,160
Now what we could do is we could just simply import all this.

28
00:01:50,160 --> 00:02:00,540
So let's go ahead and say in part the come to the max pull to and the dense layer coming back to our

29
00:02:00,540 --> 00:02:06,900
documentation we could check out on the max pull two D So there we go we have Max pull to DD.

30
00:02:08,040 --> 00:02:14,910
We'll specify the pull size, which is equal to and then the number of stripes equal to pattern is valid

31
00:02:14,910 --> 00:02:16,260
and data format.

32
00:02:16,260 --> 00:02:17,730
We're not going to specify that.

33
00:02:17,730 --> 00:02:22,620
So we have our MAX pull to DD and then this pull in size with the stripes.

34
00:02:22,620 --> 00:02:23,640
We copy that.

35
00:02:24,060 --> 00:02:27,090
We actually don't know the stride of two, so we replace that.

36
00:02:27,090 --> 00:02:28,440
We have a straight of two.

37
00:02:28,470 --> 00:02:35,160
The next step is this one right here, similar to what we had seen previously with a difference that

38
00:02:35,160 --> 00:02:42,150
now we have 16 number of filters and so we could simply copy this and then paste this out right here

39
00:02:42,150 --> 00:02:46,110
we have come to the max, pull two DD Now come to the max two.

40
00:02:46,110 --> 00:02:49,290
DD And then here we have 16 number of filters.

41
00:02:49,290 --> 00:02:52,140
The pattern is valid activation sigmoid.

42
00:02:52,140 --> 00:02:56,700
Then this next max pull to DD is still the same as what we had previously.

43
00:02:56,700 --> 00:02:59,400
And so we move on to the flattened layer.

44
00:02:59,970 --> 00:03:06,420
We add this here we have flatten, there we go and we run that.

45
00:03:06,420 --> 00:03:12,870
So while that's running, we just simply come right here and then add that flattened layer.

46
00:03:12,870 --> 00:03:19,950
So we have this flattened layer which is in charge of flooding this or converting this into this one.

47
00:03:19,950 --> 00:03:26,310
The output from this flatten, we now have a dense layer, which is what we've seen already.

48
00:03:26,310 --> 00:03:32,670
So we just have to put this dense layer here, stick this like this, and there we go.

49
00:03:32,670 --> 00:03:37,560
So we have our dense layer and then the activation is sigmoid.

50
00:03:37,560 --> 00:03:42,450
So we're respecting the activation using the low net paper.

51
00:03:42,450 --> 00:03:50,580
Then we have this here, take 1000 and then we have that, we add another dense layer and this other

52
00:03:50,580 --> 00:03:51,560
dense layer.

53
00:03:51,570 --> 00:04:01,590
Now we'll make sure that as we create this final dense layer right here, it has an output of two neurons

54
00:04:01,590 --> 00:04:06,060
since we are dealing with a binary classification problem.

55
00:04:07,230 --> 00:04:08,310
So that's fine.

56
00:04:08,310 --> 00:04:11,850
Take this here and then run our model.

57
00:04:12,390 --> 00:04:13,020
We have it.

58
00:04:13,020 --> 00:04:14,880
That input layer is not defined.

59
00:04:14,880 --> 00:04:24,270
So let's simply add that here we have the input layer, we run that and then check that out again.

60
00:04:24,960 --> 00:04:25,590
There we go.

61
00:04:25,590 --> 00:04:30,180
We have this input layer which we run, which we add, and then we run this.

62
00:04:30,180 --> 00:04:31,770
Now everything is fine.

63
00:04:31,770 --> 00:04:32,730
So that's it.

64
00:04:32,730 --> 00:04:39,450
We have 45 million parameters and no non trainable parameter.

65
00:04:40,290 --> 00:04:47,820
Notice how the this dense layer here is responsible for a huge percentage of our parameters.

66
00:04:47,820 --> 00:04:49,440
So we could reduce this.

67
00:04:49,440 --> 00:04:52,740
Let's take this to 100 and then this to like ten.

68
00:04:52,770 --> 00:04:54,090
Let's run that again.

69
00:04:54,090 --> 00:04:55,320
And there we go.

70
00:04:55,320 --> 00:04:57,780
We have a smaller model this time around.

71
00:04:58,560 --> 00:04:59,970
A point and notice is not.

72
00:05:00,300 --> 00:05:02,750
Parameters which we pre calculated here.

73
00:05:02,750 --> 00:05:06,480
Yea, we have 456 and we have 2460.

74
00:05:07,110 --> 00:05:12,510
And we'll see how we get exactly this number of values here for the dense layer.

75
00:05:12,540 --> 00:05:20,460
It's quite obvious as we just have 100 times ten plus the ten biases giving us 100 times 10 to 1000

76
00:05:20,460 --> 00:05:23,180
plus ten giving us 1010.

77
00:05:23,190 --> 00:05:28,710
And then here we have ten times two, 20, 20, plus two biases giving us 22.

78
00:05:28,740 --> 00:05:32,970
It should also be noted that there was a slight error here, as we don't have.

79
00:05:32,970 --> 00:05:40,320
Like with this, we have five by five by three, but there is five by five by six since we have the

80
00:05:40,320 --> 00:05:42,660
input number of channels equals six.

81
00:05:42,660 --> 00:05:49,800
So this means this is five by five by six and here is five, by five by three, All this five by five

82
00:05:49,830 --> 00:05:51,900
by three and all this five by five by six.

83
00:05:52,290 --> 00:05:59,490
And if you take five by five by six and multiply it 16 times, you should have 2416.

84
00:05:59,520 --> 00:06:04,470
It should be noted that here we're trying to replicate the learned architecture.

85
00:06:04,470 --> 00:06:10,530
And this is in no way the state of the art kinds of models we use today.

86
00:06:10,530 --> 00:06:16,110
So in the section on the corrective measures, we are going to use even better models.

87
00:06:16,110 --> 00:06:19,140
For now, let's just work with this.
