1
00:00:00,750 --> 00:00:01,410
Hello.

2
00:00:01,470 --> 00:00:02,020
Welcome back.

3
00:00:02,310 --> 00:00:09,300
So let's see how to create the single input single output neural network.

4
00:00:09,390 --> 00:00:11,900
I'm going to create a new project by coming over here.

5
00:00:11,910 --> 00:00:15,870
You you Vision project and

6
00:00:20,980 --> 00:00:29,050
I'm going to create a new folder to hold this OR CALL THIS SINGLE IN SINGLE OUT

7
00:00:46,300 --> 00:00:49,090
AND I'M GOING TO CALL THIS UM.

8
00:00:49,810 --> 00:00:52,910
I'M GOING TO CALL A simple n in the project name is going to be simple.

9
00:00:52,950 --> 00:00:58,930
And because what I want us to do is we should just copy the same project and rename the folder name

10
00:00:58,960 --> 00:01:03,220
and continue from there rather than create a project from scratch each time.

11
00:01:03,270 --> 00:01:09,670
So I'm gonna call it a project single and in a simple and I should say and I'm going to select my Board

12
00:01:09,730 --> 00:01:21,220
estimates to f 4 1 1 V A T S this over here okay on The Simpsons or select call on the device startup.

13
00:01:22,060 --> 00:01:24,440
Okay.

14
00:01:24,880 --> 00:01:25,420
And um

15
00:01:30,220 --> 00:01:32,210
I'm gonna create a number of files.

16
00:01:32,500 --> 00:01:35,140
My target is the SDM that's 2 4

17
00:01:37,870 --> 00:01:51,770
and I'll come over here or create or create up and I'll create another I'll say add group over here

18
00:01:52,120 --> 00:01:58,790
just to make things look better or add another group and I renamed this to an end lip.

19
00:01:58,850 --> 00:02:07,100
And remember this a very simple neural network and this will allow you to understand how um neural networks

20
00:02:07,160 --> 00:02:09,610
are constructed from C language.

21
00:02:09,620 --> 00:02:14,750
This will play your mind and you'll be able to picture neural networks in your mind and you'll be able

22
00:02:14,750 --> 00:02:17,130
to draw them on a paper write code for them.

23
00:02:17,240 --> 00:02:20,410
You have to go through this before you start using libraries.

24
00:02:20,420 --> 00:02:21,850
It is better this way.

25
00:02:22,380 --> 00:02:23,680
Right.

26
00:02:23,780 --> 00:02:32,920
So what I'm going to do is I'm going to include I'm going to include a where were you at the library

27
00:02:32,920 --> 00:02:36,260
to this project so that we can produce our resort.

28
00:02:36,880 --> 00:02:39,150
We can be able to view it.

29
00:02:39,370 --> 00:02:50,170
So we have this year I'm going to create a photo to store our House Call this you UT because I kept

30
00:02:50,170 --> 00:02:52,530
this in D um D plan and forward.

31
00:02:55,070 --> 00:02:56,200
So just bear with me.

32
00:02:57,440 --> 00:03:00,660
When I take everything from this and put it here.

33
00:03:00,670 --> 00:03:01,080
Right.

34
00:03:01,090 --> 00:03:04,080
So this this is our You are the library.

35
00:03:04,080 --> 00:03:06,690
Do you want to dot sea and Dot H.

36
00:03:07,000 --> 00:03:15,830
Do you want to drive or I should say I'm gonna put it in a single in single out project right.

37
00:03:16,540 --> 00:03:17,140
And

38
00:03:21,330 --> 00:03:24,100
I'm gonna add another source group here.

39
00:03:24,890 --> 00:03:26,360
I'll call those drivers.

40
00:03:28,560 --> 00:03:31,900
And in here I'm going to bring our you up stuff

41
00:03:42,000 --> 00:03:47,110
so we have our U S drivers here right.

42
00:03:47,860 --> 00:03:52,570
So in up I'm going to create a women that see for each new item to group.

43
00:03:52,840 --> 00:03:54,520
I'm gonna give this a name mean

44
00:03:57,970 --> 00:04:00,990
and in n n lib I'm going to create a new file.

45
00:04:01,000 --> 00:04:05,520
I'm going to call this simple road network very long name

46
00:04:09,920 --> 00:04:12,430
a call a simple neural networks.

47
00:04:12,430 --> 00:04:13,890
I'm gonna use a plural form.

48
00:04:13,900 --> 00:04:16,860
Course we're going to be updating the file with different architectures.

49
00:04:16,990 --> 00:04:18,600
Simple neural networks.

50
00:04:19,090 --> 00:04:25,510
Okay I'm gonna copy this because the DOT h file is going to have the same name.

51
00:04:25,920 --> 00:04:29,260
ATA new item select h over here.

52
00:04:29,480 --> 00:04:32,190
Paste this over here and then add.

53
00:04:32,410 --> 00:04:34,580
Right.

54
00:04:35,050 --> 00:04:43,080
So let's take a look at a single input single output neural network again.

55
00:04:43,360 --> 00:04:45,800
This is what it looks like.

56
00:04:45,910 --> 00:04:47,240
This is what we saw in D.

57
00:04:47,250 --> 00:04:49,480
Theoretical class.

58
00:04:49,480 --> 00:04:50,540
We have an input.

59
00:04:50,650 --> 00:04:59,390
The input interacts with the weight and produces an output input weight output and the interaction is

60
00:04:59,410 --> 00:05:04,880
a simple multiplication input multiplied by weight equals output.

61
00:05:04,900 --> 00:05:08,230
That is it very straightforward right.

62
00:05:09,310 --> 00:05:13,990
So I'm going to do if not define defined here to prevent

63
00:05:17,700 --> 00:05:19,800
to prevent multiple inclusions.

64
00:05:20,920 --> 00:05:24,900
If and F underscore underscore

65
00:05:30,230 --> 00:05:33,470
simple neural network

66
00:05:39,030 --> 00:05:41,400
then define underscore underscore

67
00:05:46,040 --> 00:05:48,880
simple neural network.

68
00:05:49,460 --> 00:05:50,890
Then we end if.

69
00:05:50,960 --> 00:05:53,370
Over here.

70
00:05:53,390 --> 00:05:54,940
Right.

71
00:05:55,270 --> 00:05:58,540
And um we are going to create a simple function.

72
00:06:01,370 --> 00:06:06,800
I'm going to see this function is going to return the output so I'll see and fetch it to underscore

73
00:06:06,830 --> 00:06:13,700
t presumably that's the data type we use in that it to on the score T and the function is going to be

74
00:06:15,410 --> 00:06:16,070
single

75
00:06:19,440 --> 00:06:27,260
single in single out and n and this function is going to take two parameters.

76
00:06:27,690 --> 00:06:36,180
The first one is off and set it to underscore T as well and that's the input and the second one is into

77
00:06:36,180 --> 00:06:36,450
third.

78
00:06:36,450 --> 00:06:41,960
To underscore t this the weight right.

79
00:06:42,000 --> 00:06:49,980
The reason we have the marks on the instead to underscore t is because we've not included the STV int

80
00:06:50,490 --> 00:06:58,110
so to include STV into that h over here and it's disappeared.

81
00:06:58,110 --> 00:06:58,500
Right.

82
00:06:59,130 --> 00:07:00,420
So that's what we have.

83
00:07:01,200 --> 00:07:07,260
So we can go to a wider C for a simple neural networks or C and include this dot each file though we've

84
00:07:07,260 --> 00:07:12,270
just created s I'll say include

85
00:07:19,330 --> 00:07:26,320
input neural networks dot h like this.

86
00:07:28,300 --> 00:07:31,330
So once that is done we've got to implement this function.

87
00:07:31,450 --> 00:07:35,170
I'll copy this and I'll pasted over here.

88
00:07:35,410 --> 00:07:39,250
Open and close and the implementation is simple.

89
00:07:39,370 --> 00:07:40,440
We saw that already.

90
00:07:40,450 --> 00:07:42,430
And if you're a go class.

91
00:07:42,430 --> 00:07:44,410
Simple multiplication.

92
00:07:44,410 --> 00:07:44,810
Right.

93
00:07:44,830 --> 00:07:55,230
And we returned a product so we can see the reason we have this is we forgot to clean this.

94
00:07:55,570 --> 00:07:56,830
We can say a return

95
00:07:59,840 --> 00:08:11,260
input would play by weight like this simple stuff and we can call this in the main function.

96
00:08:11,360 --> 00:08:11,710
Right.

97
00:08:11,720 --> 00:08:15,700
So we can go to our main file may not see is right here.

98
00:08:15,740 --> 00:08:19,790
We can include our U S driver but by simply doing

99
00:08:22,640 --> 00:08:28,370
include u auto H and then we can include our simple neural network

100
00:08:36,690 --> 00:08:44,010
include simple neural networks that h like this once that is done we say int main

101
00:08:46,530 --> 00:08:56,740
void open and close and we have well one over here open and close.

102
00:08:57,180 --> 00:09:00,610
So let's see are your network again.

103
00:09:00,690 --> 00:09:02,620
Okay we gave this example.

104
00:09:02,690 --> 00:09:03,420
That's okay.

105
00:09:03,420 --> 00:09:11,490
We have an array of temperature values and we want to predict it if the weight is minus 2 so let's implement

106
00:09:11,520 --> 00:09:13,110
this exact same example.

107
00:09:13,110 --> 00:09:15,070
I'm sure some of you can do this.

108
00:09:15,090 --> 00:09:16,650
You don't even need to try it.

109
00:09:16,650 --> 00:09:17,130
It's fine.

110
00:09:17,130 --> 00:09:23,070
But for those of you who want to see how this is done you can continue watching this and we can just

111
00:09:23,070 --> 00:09:25,530
declare our data here.

112
00:09:26,010 --> 00:09:31,470
Presumably this is all data and this an array of temperature values

113
00:09:36,120 --> 00:09:37,880
and the first value is twelve.

114
00:09:37,890 --> 00:09:50,340
The second is twenty three fifty minus ten and sixteen is the last one I think.

115
00:09:50,360 --> 00:09:52,050
Let's see.

116
00:09:52,470 --> 00:09:52,660
Yeah.

117
00:09:52,670 --> 00:09:54,140
It doesn't have to be the same as this.

118
00:09:54,140 --> 00:09:55,870
These are just examples.

119
00:09:57,050 --> 00:09:57,650
Okay.

120
00:09:57,680 --> 00:10:01,870
And we said we have the weight the weight is minus 2

121
00:10:06,920 --> 00:10:07,430
right.

122
00:10:07,440 --> 00:10:10,570
So when we come here we can initialize so I use it.

123
00:10:11,910 --> 00:10:14,700
So we call I use that too in its function

124
00:10:18,300 --> 00:10:19,950
and wants to use such as initialize.

125
00:10:19,950 --> 00:10:23,060
We can start running our prediction.

126
00:10:23,100 --> 00:10:26,260
This is very simple but it's still a neural network.

127
00:10:26,310 --> 00:10:34,880
We are explaining the concept of neural networks from the very simplest you know to block.

128
00:10:37,110 --> 00:10:47,160
Um so we are so primitive over here and over here I can see the the first predicted value.

129
00:10:47,160 --> 00:10:54,900
The first predictive value is from the first input which is this input here twelve the first predicted

130
00:10:54,900 --> 00:10:56,530
value I can see it is

131
00:10:59,370 --> 00:11:00,380
percentage D

132
00:11:03,630 --> 00:11:06,460
R and then n okay.

133
00:11:06,570 --> 00:11:10,120
And I can call our simple neural networks function.

134
00:11:10,350 --> 00:11:12,970
It's called Single and single out.

135
00:11:13,110 --> 00:11:13,690
Okay.

136
00:11:13,780 --> 00:11:20,110
And the first argument is the input so a temperature index 0.

137
00:11:20,190 --> 00:11:22,590
Because we see the first predicted value.

138
00:11:22,600 --> 00:11:24,020
The second argument is the weight.

139
00:11:24,270 --> 00:11:27,690
0 simply pass wait here.

140
00:11:27,690 --> 00:11:29,000
Right.

141
00:11:29,010 --> 00:11:30,650
So let's build this and see what we have.

142
00:11:36,400 --> 00:11:40,710
We're going to click here to build okay.

143
00:11:40,770 --> 00:11:41,360
No.

144
00:11:41,460 --> 00:11:44,820
Click here to download onto the board of no set.

145
00:11:44,820 --> 00:11:47,880
My debugger yet I'll click over here.

146
00:11:48,420 --> 00:11:55,860
Debug SD link debugger settings flash download reset and run.

147
00:11:55,860 --> 00:11:56,430
Okay.

148
00:11:56,490 --> 00:11:56,760
And then.

149
00:11:56,790 --> 00:11:57,920
Okay.

150
00:11:57,930 --> 00:12:05,060
Click here to download right and I'm going to open to return.

151
00:12:05,280 --> 00:12:09,810
Come over here select SD link.

152
00:12:10,230 --> 00:12:18,090
I'm gonna reset my board and it says the first predicted value is 20 for the course weights minus two

153
00:12:18,120 --> 00:12:19,920
multiplied by 12 is twenty four.

154
00:12:20,390 --> 00:12:24,210
How about we predict the second or just copy and paste this

155
00:12:27,060 --> 00:12:31,580
and then I can see a second over here.

156
00:12:31,770 --> 00:12:36,870
Third over here and over here we simply need to change the array index.

157
00:12:37,110 --> 00:12:45,390
So if we are doing this on huge data or if we automate this basically the whole thing is gonna be automated.

158
00:12:45,420 --> 00:12:50,890
The array is going to be scanned through using one line of code in all of this is going to be done by

159
00:12:50,910 --> 00:12:52,710
because I want you to understand.

160
00:12:52,710 --> 00:12:59,330
That is why I'm sure you face prediction from array index 1 second prediction array index 2 just to

161
00:12:59,340 --> 00:13:01,350
show that this is one training example.

162
00:13:01,350 --> 00:13:04,990
This is another training example etc. right.

163
00:13:05,010 --> 00:13:09,890
So that when you start seeing thousand training examples you understand.

164
00:13:10,740 --> 00:13:17,060
This is how they work you know behind you know this is how they work in the background.

165
00:13:17,070 --> 00:13:18,200
If you may.

166
00:13:18,210 --> 00:13:18,540
Right.

167
00:13:18,570 --> 00:13:24,510
So once this is done or click here to build and click here to download onto the board and we can see

168
00:13:24,510 --> 00:13:26,810
terror term right.

169
00:13:26,820 --> 00:13:31,110
This is from the previous one we can clear this clear screen.

170
00:13:31,170 --> 00:13:32,320
Our research my board.

171
00:13:33,150 --> 00:13:36,140
So we have first second and third right.

172
00:13:36,270 --> 00:13:41,400
So there s I was simple single in a single output neural network and I'll see you in the next lesson.

173
00:13:41,400 --> 00:13:42,120
Have a nice day.
