1
00:00:00,210 --> 00:00:00,590
Hello.

2
00:00:00,600 --> 00:00:01,720
Welcome back.

3
00:00:01,730 --> 00:00:03,820
So let's see how to normalize.

4
00:00:03,820 --> 00:00:06,720
I'm gonna make a copy of my last project over here

5
00:00:09,620 --> 00:00:12,730
I'm going to call this number eight.

6
00:00:14,830 --> 00:00:22,210
Muscle gain and then and then this is for normalization

7
00:00:25,780 --> 00:00:32,960
double click over here and click to open must see our architecture again.

8
00:00:33,370 --> 00:00:36,880
This is what we have we set to normalize.

9
00:00:36,970 --> 00:00:48,390
We take the value what it's X or Y value we take the vector and then we we sort of divide each element

10
00:00:48,420 --> 00:00:56,870
in the vector by the maximum element in the vector like this so you can sort of think of it as element

11
00:00:56,890 --> 00:00:57,760
Y is division.

12
00:00:59,200 --> 00:01:08,270
Okay so I'm gonna come over here and n lib gonna go to the c file over here and we're going to write

13
00:01:08,270 --> 00:01:10,640
a function to do the.

14
00:01:11,030 --> 00:01:13,180
So we are going to have a very simple function.

15
00:01:13,190 --> 00:01:17,930
The function of start off by finding the maximum element in the vector.

16
00:01:18,470 --> 00:01:23,490
And then once that is done it will go ahead to do the division.

17
00:01:23,490 --> 00:01:29,520
There are other forms of normalization which we shall see later but let's take a step by step.

18
00:01:29,750 --> 00:01:31,160
So come over here and see.

19
00:01:31,160 --> 00:01:31,640
Void

20
00:01:37,260 --> 00:01:46,830
normalize on a score data open close and then the first argument is a pointer to the input vector

21
00:01:49,530 --> 00:01:51,370
like this.

22
00:01:51,480 --> 00:01:54,210
The second argument is a pointer to the output vector

23
00:01:59,500 --> 00:02:01,250
like this.

24
00:02:01,480 --> 00:02:07,330
And the last argument is the length input and output vectors would have the same length.

25
00:02:07,990 --> 00:02:15,510
So we can simply say early in full length over here open and close.

26
00:02:15,580 --> 00:02:23,230
So like I said we start off by finding the max and you can post the video and try to accomplish this

27
00:02:23,230 --> 00:02:25,460
on your own and then impose it.

28
00:02:25,750 --> 00:02:27,970
And then we can do it together.

29
00:02:28,460 --> 00:02:36,520
So find Max over here and what I'm gonna do is create a local variable in this function which I shall

30
00:02:36,520 --> 00:02:37,180
call Max

31
00:02:40,250 --> 00:02:45,580
and I'm going to assign this to input vector index 0.

32
00:02:45,660 --> 00:02:50,660
The first element and we simply going to compare everything else to this first one.

33
00:02:51,960 --> 00:02:54,870
So over here I'm gonna use a for loop by scene for

34
00:02:57,750 --> 00:02:58,360
int i.

35
00:02:58,410 --> 00:03:03,480
Because your eye is less than Len I plus plus.

36
00:03:05,100 --> 00:03:18,600
And essentially we want to say if input vector index eye is created a mine is greater than Max over

37
00:03:18,600 --> 00:03:30,340
here we can close then max E course input vector index I over here like this.

38
00:03:34,020 --> 00:03:40,350
Once we've done this we can come out of a for loop and perform the normalization

39
00:03:49,210 --> 00:03:52,600
divide each of them by Max.

40
00:03:52,600 --> 00:03:58,850
And it's another for loop we're gonna use over here for int i.

41
00:03:59,020 --> 00:03:59,740
Cause you

42
00:04:02,630 --> 00:04:03,820
Oh yes less than Len

43
00:04:07,000 --> 00:04:14,570
then I plus plus open and close and what we're gonna do is

44
00:04:19,130 --> 00:04:20,850
output facto index.

45
00:04:20,910 --> 00:04:21,260
Hi

46
00:04:24,050 --> 00:04:28,840
equals in Perfecto index.

47
00:04:28,860 --> 00:04:29,130
Hi

48
00:04:31,880 --> 00:04:33,640
divided my marks like this

49
00:04:37,300 --> 00:04:42,310
Okay we take the function prototype and put it in the interface file over here

50
00:04:47,050 --> 00:04:49,030
and then I'm gonna put a semicolon here

51
00:04:54,050 --> 00:05:01,640
and now we can go to our main function and try it out open window see over here and it's empty.

52
00:05:01,640 --> 00:05:05,020
I'm just gonna clean everything from here.

53
00:05:05,060 --> 00:05:09,700
Let's take a look at our architecture so that we can create some defined statement.

54
00:05:09,890 --> 00:05:13,970
So what we have here is we have two features.

55
00:05:14,240 --> 00:05:19,760
So two features mean in two inputs and we have three training examples.

56
00:05:19,760 --> 00:05:27,140
Each row here represent a threat and a training example and each white column here represent a feature

57
00:05:27,140 --> 00:05:28,370
type.

58
00:05:28,370 --> 00:05:28,760
Right.

59
00:05:29,120 --> 00:05:31,030
So I'm gonna come over here and see

60
00:05:34,480 --> 00:05:40,580
zoom in a bit I'll a defined number of features

61
00:05:43,210 --> 00:05:48,440
and we said we have two features.

62
00:05:48,530 --> 00:05:50,710
I'm gonna put a comment here.

63
00:05:50,760 --> 00:05:54,250
These are what are often known as the end values.

64
00:05:54,270 --> 00:05:55,610
Now come over here defined

65
00:06:00,200 --> 00:06:03,070
number of examples.

66
00:06:04,670 --> 00:06:07,660
And we have three examples here.

67
00:06:07,960 --> 00:06:14,430
In the example numbers often denote US m right.

68
00:06:14,450 --> 00:06:21,770
Once that is done I'm gonna say I'm gonna create a factor here.

69
00:06:21,770 --> 00:06:23,840
Open this up for will comment.

70
00:06:23,870 --> 00:06:25,820
Hours of work out data

71
00:06:32,250 --> 00:06:34,510
and we're going to have another one here.

72
00:06:38,620 --> 00:06:48,840
Hours of rest data and I'll come over here and say double we can see hours of work our data is x 1 we'll

73
00:06:48,860 --> 00:06:58,490
see double X one x number of examples the size is number of examples

74
00:07:04,390 --> 00:07:16,800
and we've got a furnace over here and dust because the sea to work out hours of workout is to five and

75
00:07:16,800 --> 00:07:23,040
one to always five hours and then one hour I'm gonna set over here to five.

76
00:07:23,050 --> 00:07:23,410
One.

77
00:07:23,430 --> 00:07:27,740
I hope you appreciate these that step by step approach we taken.

78
00:07:27,870 --> 00:07:33,010
I'm sure it is perhaps too slow for some of you were already familiar with deep planning.

79
00:07:33,120 --> 00:07:35,190
You can completely keep up.

80
00:07:35,190 --> 00:07:35,520
You can.

81
00:07:35,590 --> 00:07:37,960
Yeah go over Oh skip this.

82
00:07:37,970 --> 00:07:42,660
This particular lesson or section if you find it a bit too mundane.

83
00:07:43,530 --> 00:07:45,900
So I'm going to have this other one here known as

84
00:07:50,330 --> 00:07:51,680
Double X too.

85
00:07:53,420 --> 00:08:00,470
And this is going to be number of the sizes the same number of training examples but this has to do

86
00:08:00,470 --> 00:08:07,520
with the hours of rest and when we start dealing with actual data we simply know we're not going to

87
00:08:07,520 --> 00:08:14,900
have this let's say 3 3 numbers like this we would end up with less ten thousand numbers essentially.

88
00:08:15,650 --> 00:08:16,060
Right.

89
00:08:16,080 --> 00:08:17,890
That's a very small dataset.

90
00:08:17,900 --> 00:08:22,700
This ridiculously small in machine learning language if you may.

91
00:08:22,700 --> 00:08:27,320
Um so number of we say x2 his hours of rest.

92
00:08:27,320 --> 00:08:28,190
Let's take a look at it.

93
00:08:28,790 --> 00:08:30,380
So we said 8 5 8.

94
00:08:30,500 --> 00:08:34,340
That's how much rest you got after your workout.

95
00:08:34,340 --> 00:08:35,540
8 5 8

96
00:08:41,370 --> 00:08:42,270
right.

97
00:08:42,420 --> 00:08:46,740
And we are going to have a third one here.

98
00:08:46,740 --> 00:08:49,990
Muscle gain does the output thus the y value.

99
00:08:50,190 --> 00:08:50,580
So

100
00:08:59,990 --> 00:09:04,160
once again data gonna come over here and see double

101
00:09:08,950 --> 00:09:10,510
This is number of examples.

102
00:09:10,510 --> 00:09:11,200
Just copy this.

103
00:09:11,200 --> 00:09:12,090
Put it over here

104
00:09:15,090 --> 00:09:23,370
and we said in the first day you gained 200 grams of muscles the next day you gain 90 grams in the third

105
00:09:23,370 --> 00:09:25,470
day you gain 190 grams.

106
00:09:25,470 --> 00:09:31,710
So we're going to design a neural network to help us know if you exercise for two hours and rest for

107
00:09:31,710 --> 00:09:32,400
seven hours.

108
00:09:32,400 --> 00:09:36,410
How many grams of muscles you'd gain essentially.

109
00:09:36,410 --> 00:09:42,820
And um yeah sort of values are two hundred ninety and one ninety like this.

110
00:09:43,050 --> 00:09:48,400
So I'm gonna create empty buffers here to store the normalized versions.

111
00:09:48,450 --> 00:09:56,460
So a double I'll see underscore x 2 and this has the same size as x 2 and we're gonna normalize that

112
00:09:56,460 --> 00:10:04,040
sort of value in here and in the same way we're gonna have this should be x 1.

113
00:10:04,710 --> 00:10:11,280
This is x 1 proper underscore x 1 is the normalized version so we're gonna have an x 2 version and it's

114
00:10:11,280 --> 00:10:17,430
the same thing and we're gonna have underscore y version because we're going to normalize y as well

115
00:10:22,520 --> 00:10:22,990
right.

116
00:10:23,000 --> 00:10:32,030
So once that is done we can come in here to our main function and call our function C normalize data.

117
00:10:32,150 --> 00:10:35,640
The first is the input vector which is x 1.

118
00:10:35,660 --> 00:10:42,080
The second argument is the output vector which is underscore x 1 0 x 1 prime if you want to call it

119
00:10:42,080 --> 00:10:42,320
that.

120
00:10:42,620 --> 00:10:52,760
It's just strange you cannot use the actual primes symbol encode and um the length is number of examples.

121
00:10:53,060 --> 00:10:54,590
So we've normalized x1.

122
00:10:54,590 --> 00:10:57,170
We can copy and paste the 4 x 2 as well as y

123
00:11:00,880 --> 00:11:01,870
paste over here

124
00:11:06,960 --> 00:11:11,940
x2 x2 pitched over here

125
00:11:16,180 --> 00:11:21,350
y and then Y underscore Y.

126
00:11:21,430 --> 00:11:21,940
Right.

127
00:11:21,940 --> 00:11:29,570
So after this we would have normalized our features which are our inputs and then our outputs as well.

128
00:11:30,070 --> 00:11:33,460
So I simply put a bit of print FS over here print f

129
00:11:36,290 --> 00:11:39,560
row X1 data

130
00:11:42,410 --> 00:11:44,530
and then put a new line here.

131
00:11:48,560 --> 00:11:50,810
And then I'm simply going to use a for loop

132
00:11:54,700 --> 00:12:01,240
Y is less than number of examples Hi plus plus.

133
00:12:01,240 --> 00:12:02,970
OPEN AND CLOSE.

134
00:12:03,450 --> 00:12:05,830
AND THEN WE SIMPLY GONNA DO print f

135
00:12:08,890 --> 00:12:09,790
percentage F

136
00:12:12,740 --> 00:12:16,510
and then X1 index.

137
00:12:16,550 --> 00:12:25,110
I like this right and I'm going to copy and paste this.

138
00:12:25,550 --> 00:12:27,400
Now see normalized X1

139
00:12:35,230 --> 00:12:43,780
and over here we simply going to print the content of the underscore X1 buffer and I'm going to paste

140
00:12:43,930 --> 00:12:48,190
this over here and see x2 data over here.

141
00:12:48,190 --> 00:12:56,170
We simply going to print the content of the X2 buffer page this over here normalized x2

142
00:13:03,580 --> 00:13:12,880
and we're going gonna print underscore x2 content over here and then page this over here and this becomes

143
00:13:13,330 --> 00:13:22,770
raw why data go into print y values here and then normalized y data.

144
00:13:22,940 --> 00:13:32,470
Gonna print the content of underscore y over here like this so we can build and see what it looks like.

145
00:13:32,500 --> 00:13:36,370
I'm gonna click over here to Butte to build in

146
00:13:39,720 --> 00:13:48,670
it's build successfully Queen to download onto my board by clicking over here and it's downloaded this

147
00:13:48,760 --> 00:13:50,640
up in terror term and see what we have.

148
00:13:50,650 --> 00:13:51,880
Click over here to open

149
00:13:55,670 --> 00:14:00,830
I'm going to reset my board and this is where we have a c

150
00:14:05,200 --> 00:14:09,310
um we forgot to put a number of new ID lines.

151
00:14:09,310 --> 00:14:14,370
Sorry about that I just put some new lines between them to formatted better.

152
00:14:16,830 --> 00:14:17,960
Let's see.

153
00:14:18,010 --> 00:14:23,480
Print a new line here print another one here another one here.

154
00:14:24,640 --> 00:14:28,260
Yeah this one here reviewed

155
00:14:31,220 --> 00:14:34,340
download onto the port of Interior to

156
00:14:38,450 --> 00:14:41,200
research my board right.

157
00:14:41,250 --> 00:14:42,360
And this is what we have

158
00:14:49,630 --> 00:14:52,070
we have the raw X1 values.

159
00:14:52,480 --> 00:14:54,920
And when we normalized in this what we get.

160
00:14:54,970 --> 00:15:02,260
Remember we said when we normalize we make it value fall between 0 and 1 and we did the same for x 2.

161
00:15:02,500 --> 00:15:05,600
We did it for the y values as well.

162
00:15:06,040 --> 00:15:06,570
Right.

163
00:15:06,580 --> 00:15:09,120
So that's all there is for this lesson if you have any questions at all.

164
00:15:09,130 --> 00:15:11,020
Just let me know and I'll see you later.

165
00:15:11,020 --> 00:15:14,440
Have a nice day and I'm going to zoom the terror team in.

166
00:15:14,440 --> 00:15:16,640
I'm going to find a way to increase the font size.

167
00:15:17,050 --> 00:15:18,990
Sorry about the small font over here.

168
00:15:19,170 --> 00:15:19,390
Yeah.

169
00:15:21,930 --> 00:15:26,870
So to increase the font size here you can simply come over here.

170
00:15:26,930 --> 00:15:28,830
I think it's somewhere here.

171
00:15:28,830 --> 00:15:37,620
There is font somewhere set up font and then you click on font over here and we can select bigger font

172
00:15:38,730 --> 00:15:42,390
and we can even change the type when I use 16 over here.

173
00:15:42,420 --> 00:15:44,230
Let's see what we have right.

174
00:15:44,250 --> 00:15:46,140
So this is going to be our new font size.

175
00:15:46,680 --> 00:15:47,560
Yeah.

176
00:15:47,820 --> 00:15:52,280
So sorry for the earlier lessons with smaller font and I'll see you later.
