1
00:00:00,750 --> 00:00:01,130
Hello.

2
00:00:01,170 --> 00:00:01,730
Welcome back.

3
00:00:02,460 --> 00:00:07,380
Let's continue in this lesson we are going to perform a bit of pre processing.

4
00:00:07,470 --> 00:00:11,460
We are going to reshape our image and normalize it.

5
00:00:11,520 --> 00:00:17,790
Remember we've got a convert to what image to a column vector and feed it to our neural network.

6
00:00:17,820 --> 00:00:18,600
This is what I want.

7
00:00:18,610 --> 00:00:26,670
Your network is going to be this was going to look like this is how what image we have we would have

8
00:00:26,790 --> 00:00:31,920
twelve thousand two hundred and eighty seven pixel values.

9
00:00:32,240 --> 00:00:37,270
And this is arranged in the square shape or this rectangular shape and we've got three of them.

10
00:00:37,460 --> 00:00:42,850
We've got to convert all of them and make them into a column vector.

11
00:00:43,310 --> 00:00:48,590
And once that is done we are going to normalize it and then feed through our new to our neural network.

12
00:00:49,250 --> 00:00:51,440
So we feed it to our neural network.

13
00:00:51,440 --> 00:00:57,890
We come over here we perform inputs which plus bias we pass it through the red blue activation and then

14
00:00:57,890 --> 00:01:02,420
the results that we get it becomes the input for the next layer.

15
00:01:02,420 --> 00:01:03,560
So this the next layer.

16
00:01:04,040 --> 00:01:11,920
And then we take these a values and then dot product with a weight out the bias to which is the the

17
00:01:11,990 --> 00:01:13,910
second bias values that we have.

18
00:01:14,150 --> 00:01:15,700
And then we pass it through our sigmoid.

19
00:01:15,710 --> 00:01:17,450
This should be a sigmoid no irrelevant.

20
00:01:17,760 --> 00:01:19,080
I have a typo here.

21
00:01:19,160 --> 00:01:21,860
We pass it through our sigmoid activation function.

22
00:01:22,040 --> 00:01:28,810
And based on what we get if the value is greater than 2.5 it's a cut if it is not then it's not a cut.

23
00:01:28,970 --> 00:01:30,360
Right.

24
00:01:30,820 --> 00:01:39,020
So I'm going to come over here and flatten the image meaning converted to you know a column vector

25
00:01:41,840 --> 00:01:49,130
or a real vector or would it transpose or c train X on a score flatten.

26
00:01:49,140 --> 00:01:51,580
This is going to be the variable to store it.

27
00:01:51,720 --> 00:01:59,310
And what I'm going to do is I'm going to take green X original and then I'll C reshape

28
00:02:02,140 --> 00:02:09,220
and what I'm gonna do is create X original over here dot shape

29
00:02:13,080 --> 00:02:13,830
index you

30
00:02:18,500 --> 00:02:30,240
and then plus minus one over here and then take the transpose of this we put at minus one here to make

31
00:02:30,240 --> 00:02:40,050
the shape up the minus one makes the reshape flatten the remaining dimensions remember I selected this

32
00:02:40,050 --> 00:02:47,470
dimension zero and then put minus one meaning flatten every other dimension essentially um and we want

33
00:02:47,470 --> 00:03:01,770
to do it for the test sets us Well I'm gonna come down here and say test X on the score flatten course

34
00:03:03,210 --> 00:03:04,100
test original

35
00:03:10,070 --> 00:03:11,740
dot to reshape

36
00:03:19,670 --> 00:03:31,850
and then test original dot shape index you come up minus one and then transpose like this.

37
00:03:31,850 --> 00:03:39,150
Okay so once that is done we are going to take everything and normalize it because our you may just

38
00:03:39,230 --> 00:03:43,520
each bit the largest value in that you make is gonna be two hundred and fifty five.

39
00:03:43,520 --> 00:03:52,160
So we going to divide each item by two hundred and fifty five to perform our normalization up with some

40
00:03:52,160 --> 00:03:52,730
comments here

41
00:04:07,140 --> 00:04:07,650
right.

42
00:04:08,480 --> 00:04:18,320
So when I say green X this what we shall put into on your network train X equals green X flatten divided

43
00:04:18,320 --> 00:04:23,470
by two fifty five and then test X

44
00:04:27,590 --> 00:04:38,500
you cause test X flatten divided by two hundred and fifty five like this right.

45
00:04:38,520 --> 00:04:45,330
So we are done with a pre process in the next lesson we shall put together what we've pre processed

46
00:04:45,360 --> 00:04:51,260
and the functions from our library to build up our model.

47
00:04:51,720 --> 00:04:52,710
So I'll see you in the next.
