1
00:00:00,760 --> 00:00:01,170
Hello.

2
00:00:01,230 --> 00:00:02,070
Welcome back.

3
00:00:02,070 --> 00:00:05,430
So currently our image is still not a column vector.

4
00:00:05,430 --> 00:00:08,100
We saw the dimension of our image.

5
00:00:08,100 --> 00:00:08,710
Let's see.

6
00:00:10,230 --> 00:00:13,970
So this the dimension the dimension of our images still.

7
00:00:14,210 --> 00:00:17,180
Um well this the dimension of the entire set.

8
00:00:17,190 --> 00:00:21,750
But we know the dimension of the image at least is sixty four by sixty four by three.

9
00:00:21,750 --> 00:00:24,720
We've got to change this into a column vector.

10
00:00:24,720 --> 00:00:27,570
We've got to change this into just this.

11
00:00:27,570 --> 00:00:34,350
We have got to make it like this mean in one column and then over 12000 rows.

12
00:00:34,560 --> 00:00:41,280
And once we do this for a single image for the entire image sets we're going to have these number of

13
00:00:41,280 --> 00:00:46,230
columns number of columns will be equal to the number of training examples a number of rows will be

14
00:00:46,230 --> 00:00:47,280
equal to this number.

15
00:00:47,310 --> 00:00:50,580
We have to flatten each image to a column vector.

16
00:00:50,670 --> 00:00:51,690
That is what we have to do now.

17
00:00:51,720 --> 00:00:53,740
That's the pre processing we need to do.

18
00:00:53,760 --> 00:01:00,410
So let's do the math and I'm going to comment this.

19
00:01:00,430 --> 00:01:01,890
I'm going to say it again

20
00:01:04,950 --> 00:01:08,970
call this number three and then

21
00:01:11,890 --> 00:01:16,190
I'm going to form this once we are done we can clean the format we can clean the comment.

22
00:01:16,450 --> 00:01:23,320
Yeah but I think if it's your first time doing this will be nice to have the test point for test it

23
00:01:23,830 --> 00:01:28,660
before it becomes complicated all of a sudden yeah.

24
00:01:28,780 --> 00:01:29,140
So

25
00:01:32,100 --> 00:01:33,870
so we going to come down here

26
00:01:37,290 --> 00:01:39,390
and then I'm going to say

27
00:01:42,130 --> 00:01:54,360
Qur'an set X flatten we're going to flatten the image and all we're gonna do is take train sets X original

28
00:01:55,890 --> 00:02:02,370
and then we're going to use a function on us reshape so a dot reshape

29
00:02:05,040 --> 00:02:17,060
what we want to reshape is train set one or reshape it to this train set X original index 0 and then

30
00:02:17,190 --> 00:02:24,690
minus 1 and then the transpose of this right we're gonna do the same for test set X

31
00:02:41,860 --> 00:02:44,050
and go see the

32
00:02:48,750 --> 00:02:50,670
right index here over here

33
00:02:53,790 --> 00:03:00,160
and then transpose once that is done we can print out the result and see what we have

34
00:03:11,480 --> 00:03:22,380
you can see a new image shape is then we can just use the STAR function and then I'm simply going to

35
00:03:22,380 --> 00:03:22,950
call this

36
00:03:32,490 --> 00:03:34,280
the sentence does and so on repos

37
00:03:38,970 --> 00:03:44,410
Chris set X shape is this okay.

38
00:03:44,590 --> 00:03:46,330
And then we're going to

39
00:03:48,970 --> 00:03:49,990
check the tests at

40
00:03:59,860 --> 00:04:00,820
right.

41
00:04:00,830 --> 00:04:04,400
We already saw the um the shape of the of the Y.

42
00:04:04,400 --> 00:04:06,000
We know the shape of the Y already.

43
00:04:06,030 --> 00:04:14,690
It was one by two hundred and nine which is the um which is the number of images oh just this you'll

44
00:04:14,700 --> 00:04:20,720
see I'm going to copy this and bring it over here.

45
00:04:20,740 --> 00:04:22,140
Nice view this as well.

46
00:04:22,640 --> 00:04:30,180
If you forgot and then I'm going to copy this controversy to copy put it over here.

47
00:04:30,260 --> 00:04:35,600
This has to be screwed contra s when I run this run module

48
00:04:40,580 --> 00:04:44,320
only into just color arrays can be converted to escalate index.

49
00:04:44,330 --> 00:04:45,860
Okay let's see where the error lies.

50
00:04:49,710 --> 00:04:50,000
Yeah.

51
00:04:50,140 --> 00:04:57,450
So over here I forgot to change the word here to test this front and see what up this is the cause of

52
00:04:57,450 --> 00:05:00,300
the arrow run module.

53
00:05:01,470 --> 00:05:01,860
Okay.

54
00:05:01,860 --> 00:05:06,170
Green set X flatten train set X or reshape the train set.

55
00:05:06,190 --> 00:05:07,380
X okay

56
00:05:15,540 --> 00:05:15,930
yeah.

57
00:05:15,980 --> 00:05:17,690
The courses from here.

58
00:05:17,690 --> 00:05:24,390
I forgot I was extracting the shape that's index 0.

59
00:05:24,430 --> 00:05:24,750
Okay.

60
00:05:24,770 --> 00:05:30,350
Control s run module.

61
00:05:30,860 --> 00:05:35,580
Kind of reshape array of size this into shape of this okay.

62
00:05:38,180 --> 00:05:38,900
Um yeah.

63
00:05:38,940 --> 00:05:39,560
Sorry about that.

64
00:05:39,570 --> 00:05:40,580
It's my fault.

65
00:05:40,650 --> 00:05:45,730
During my copy and paste in this is the mistake I made over here.

66
00:05:45,780 --> 00:05:52,050
I should be typing I should create a new variable I meant to create a new variable by changing this

67
00:05:52,050 --> 00:05:53,970
word here to test.

68
00:05:54,180 --> 00:05:58,500
So it's as if we were trying to reshape Um this this one again.

69
00:05:58,500 --> 00:06:00,640
That is why we received the arrow.

70
00:06:00,870 --> 00:06:01,400
Let's see now.

71
00:06:01,410 --> 00:06:08,010
So we have train sets X flatten test set X flatten and we have you in train sets X flatten test sets

72
00:06:08,130 --> 00:06:09,250
X flatten.

73
00:06:09,420 --> 00:06:11,260
Okay.

74
00:06:11,580 --> 00:06:12,330
Run module

75
00:06:15,130 --> 00:06:16,680
we still get in the same area.

76
00:06:16,690 --> 00:06:20,950
Test set X flatten test set on a score.

77
00:06:20,980 --> 00:06:25,740
Original 3 shape.

78
00:06:27,920 --> 00:06:29,070
Uh yeah.

79
00:06:29,100 --> 00:06:30,630
There with me.

80
00:06:30,630 --> 00:06:32,280
It's from here.

81
00:06:32,300 --> 00:06:36,120
Um I'm sure some of you have a go at me in the review section.

82
00:06:36,120 --> 00:06:36,840
Just bear with me.

83
00:06:36,850 --> 00:06:37,110
Yeah.

84
00:06:37,330 --> 00:06:38,080
Um yeah.

85
00:06:39,050 --> 00:06:39,640
So yeah.

86
00:06:39,790 --> 00:06:40,080
Yeah.

87
00:06:40,080 --> 00:06:41,210
This the last type.

88
00:06:41,280 --> 00:06:43,450
Yeah.

89
00:06:43,950 --> 00:06:45,050
Okay let's see now.

90
00:06:45,660 --> 00:06:46,190
Okay.

91
00:06:46,200 --> 00:06:46,610
Voila.

92
00:06:46,650 --> 00:06:48,690
Yeah we go so we don't have a go at me.

93
00:06:48,690 --> 00:06:49,030
Yeah.

94
00:06:49,590 --> 00:06:49,940
Okay.

95
00:06:50,010 --> 00:06:51,790
So um let's see.

96
00:06:51,790 --> 00:06:58,170
Train set X shape is this and then it's printing out into shape.

97
00:06:58,170 --> 00:06:59,550
Okay we'll fix that later.

98
00:07:00,060 --> 00:07:06,570
So we have the Y shape we know this already the Y set is one by two hundred and nine one by number of

99
00:07:06,600 --> 00:07:08,330
images we saw this.

100
00:07:08,340 --> 00:07:11,210
Let's see if our image shows this.

101
00:07:11,220 --> 00:07:18,210
We said we're going to take Y we're going to take all of y values and store them in a vector like this.

102
00:07:18,240 --> 00:07:20,950
So it's one dimensional in a way.

103
00:07:22,140 --> 00:07:27,120
So one by two or nine we have this stored like this.

104
00:07:27,120 --> 00:07:33,600
This is stored in a real vector we have we have multiple rows single.

105
00:07:33,990 --> 00:07:40,510
This is stored in a row vector we have multiple columns a single row and this is the one for the test.

106
00:07:40,560 --> 00:07:41,650
Okay.

107
00:07:41,730 --> 00:07:42,440
Right.

108
00:07:42,540 --> 00:07:42,840
Okay.

109
00:07:42,870 --> 00:07:43,910
Let's shorten this

110
00:07:46,970 --> 00:07:53,120
okay so what I meant to print was Dot shape not the entire thing.

111
00:07:53,510 --> 00:07:53,910
Okay.

112
00:07:53,930 --> 00:07:55,130
Control is to save

113
00:08:00,150 --> 00:08:02,780
Okay so that's the shape of our train set.

114
00:08:02,850 --> 00:08:07,070
X this is the shape now by the number of images.

115
00:08:07,070 --> 00:08:09,120
This the dimension of a single image.

116
00:08:09,140 --> 00:08:12,670
So this here represents the number of rows we have.

117
00:08:12,680 --> 00:08:18,860
This represents the number of columns and we can verify that from our image.

118
00:08:18,860 --> 00:08:19,360
Right.

119
00:08:19,380 --> 00:08:27,730
As you can see a single column starts from zero and at twelve thousand two hundred and eighty eight.

120
00:08:28,550 --> 00:08:36,800
And we've got multiple columns the number of columns we call equal to m m means the number of training

121
00:08:36,800 --> 00:08:38,040
examples.

122
00:08:38,060 --> 00:08:42,710
And over here we have two hundred and nineteen examples hence we have twelve thousand two hundred and

123
00:08:42,740 --> 00:08:44,870
eighty eight by two hundred and nine.

124
00:08:44,880 --> 00:08:50,380
And we have the same image the same image type but this time 50 of them for testing.

125
00:08:50,840 --> 00:08:53,300
And then we spoke about the Y already.

126
00:08:53,360 --> 00:08:53,750
So yeah.

127
00:08:53,750 --> 00:08:59,420
This the pre processing required in order to to feed the image to our neural network.

128
00:08:59,420 --> 00:09:05,600
So these this the flattened version is going to be the the version we feed into the neural network.

129
00:09:05,600 --> 00:09:09,740
Like we discussed in the theoretical class this all there is for this lesson if you have any questions

130
00:09:09,740 --> 00:09:10,040
at all.

131
00:09:10,040 --> 00:09:10,810
Just let me know.

132
00:09:10,940 --> 00:09:16,580
And sorry for the um the typos and all the other stuff but certainly you can have a go at me in the

133
00:09:16,580 --> 00:09:19,440
review section and um simulator.

134
00:09:19,440 --> 00:09:20,380
Have a nice day.
