1
00:00:00,900 --> 00:00:07,380
In this session, we want to see what's the effect of choosing different numbers of neurons in our head

2
00:00:07,380 --> 00:00:08,010
and linger.

3
00:00:08,880 --> 00:00:11,030
Now, let's take a look at this one.

4
00:00:11,040 --> 00:00:18,240
I'm going to use X1 and why two X1 has 50 samples and why one is equal to sign us up x1.

5
00:00:18,480 --> 00:00:20,520
This is over target to Ivon.

6
00:00:20,790 --> 00:00:22,800
We're looking for a sign of X.

7
00:00:23,730 --> 00:00:25,180
I already plotted them.

8
00:00:25,380 --> 00:00:31,710
Now let's just call a tool or simply click on neural net fitting tools.

9
00:00:32,820 --> 00:00:40,530
Here is of our neural network and as you can see, the activation function of each layer is here for

10
00:00:40,530 --> 00:00:42,230
this one forever hidden layer.

11
00:00:42,240 --> 00:00:49,260
We are using the sigmoid activation function and we use this one whenever we want to have a pattern

12
00:00:49,260 --> 00:00:50,190
recognition.

13
00:00:50,250 --> 00:00:59,430
We just want to classify them into different sets and for our altered layer, it just used linear function.

14
00:00:59,940 --> 00:01:03,510
So click on next and let's use of our data again.

15
00:01:03,540 --> 00:01:08,910
Why one four of our targets and of our inputs are X1.

16
00:01:09,150 --> 00:01:10,980
Each of them has 50 samples.

17
00:01:10,980 --> 00:01:12,360
Let's just click the next.

18
00:01:12,810 --> 00:01:17,460
And I'm not going to change the validation and testing percentage for now.

19
00:01:17,460 --> 00:01:19,740
Let's just remain midwifing.

20
00:01:20,580 --> 00:01:21,270
Here it is.

21
00:01:21,480 --> 00:01:26,580
I want to see the effect of different number of hidden neurons in our system.

22
00:01:26,820 --> 00:01:33,840
As I already explained, we can change the number of neurons in our hidden layer, but we cannot change

23
00:01:33,840 --> 00:01:36,850
the number of neurons in our output layer.

24
00:01:37,200 --> 00:01:42,830
The reason is we have only one output so we can not have more than one neuron here.

25
00:01:43,230 --> 00:01:51,660
If we had two outputs, then we could have two neurons and number of neurons for other outputs and there

26
00:01:51,660 --> 00:01:54,470
is equal to number of our outputs.

27
00:01:54,780 --> 00:01:57,840
But in this part, let's change it to one.

28
00:01:57,840 --> 00:02:03,990
Let's start with one and then see what would be the effect on our network.

29
00:02:04,530 --> 00:02:08,430
Click on next and then click on train.

30
00:02:11,200 --> 00:02:19,690
OK, the validation checks stopped our training, let Assad be checking the performance, OK is of our

31
00:02:19,690 --> 00:02:22,420
performance and this is the validation.

32
00:02:22,420 --> 00:02:25,680
We just start to failing and finally stopped our training.

33
00:02:26,170 --> 00:02:28,210
I'm going to check the feting.

34
00:02:28,540 --> 00:02:29,830
Let's take a look at this one.

35
00:02:30,880 --> 00:02:32,680
Can you guess what is this?

36
00:02:32,680 --> 00:02:40,060
By looking at this one, we can see this is a sigmoid and this is just like reverse of a sigmoid.

37
00:02:40,240 --> 00:02:45,340
And the reason that we can see it here, because one of the weights was negative.

38
00:02:45,760 --> 00:02:51,350
So it just got reversed and it just fitted to our data.

39
00:02:51,370 --> 00:02:52,710
Here are the data.

40
00:02:52,720 --> 00:02:54,100
Here are the samples.

41
00:02:54,610 --> 00:02:58,330
We were expecting something like that, like a sign of Suape lot.

42
00:02:58,510 --> 00:03:03,640
The best feting that the network was able to give us is this one.

43
00:03:03,710 --> 00:03:08,980
Maybe you ask your question why it just didn't took it up to here.

44
00:03:09,460 --> 00:03:17,200
If you start doing this sigmoid from here, then it can not satisfied samples.

45
00:03:17,200 --> 00:03:25,870
But by choosing and a middle this path, it can just satisfy all the samples in the same range to me.

46
00:03:25,870 --> 00:03:28,390
Just retrain the nets for this time.

47
00:03:28,390 --> 00:03:35,080
You're going to choose to narrowings for our hidden layer and see what will happen next.

48
00:03:36,190 --> 00:03:39,520
OK, here it's the training result.

49
00:03:40,090 --> 00:03:43,350
Again, the validation check has stopped our training.

50
00:03:43,360 --> 00:03:44,500
Let's see the fitting.

51
00:03:45,280 --> 00:03:46,780
OK, here it is.

52
00:03:46,840 --> 00:03:49,480
I remember we have only two narratives.

53
00:03:49,780 --> 00:03:52,210
As you can see, we have already two.

54
00:03:52,510 --> 00:03:57,610
This is one sigmoid still here and this is another sigmoid.

55
00:03:58,300 --> 00:04:06,850
Our network tried its best to fit into the data by using two sigmoid activation function and we can

56
00:04:06,850 --> 00:04:08,620
already see these two.

57
00:04:08,680 --> 00:04:11,140
This is one and this is another one.

58
00:04:11,410 --> 00:04:13,630
This one has a negative rate.

59
00:04:13,630 --> 00:04:14,950
That's why it's reversed.

60
00:04:14,950 --> 00:04:19,210
But this one is just look like a sigmoid and tonja and hyperbolic.

61
00:04:20,710 --> 00:04:31,060
OK, let's just increase the number of neurons to three and see how can our network behave with three

62
00:04:31,270 --> 00:04:32,890
neurones in a hidden layer.

63
00:04:33,550 --> 00:04:36,280
So let's go to the fitting tools and see the result.

64
00:04:36,700 --> 00:04:43,320
OK, the result now it's better with even tweaking around, we were able to have a sign in shape and

65
00:04:43,330 --> 00:04:45,430
identify the three neurons.

66
00:04:45,760 --> 00:04:47,620
Maybe this is one of them.

67
00:04:48,280 --> 00:04:50,110
This is one sigmoid.

68
00:04:50,620 --> 00:04:54,100
This is, I can say the second sigmoid.

69
00:04:54,280 --> 00:04:58,570
And from here to here, this is our third sigmoid.

70
00:04:58,960 --> 00:05:09,370
By changing the weights and testing it again, our network was able to feed the best that it can with

71
00:05:09,370 --> 00:05:12,910
using Htwe Sigmoid and three narrowings.

72
00:05:14,440 --> 00:05:21,040
Now let's increase the numbers to ten and see what would happen if we have pin neurons in our hidden

73
00:05:21,040 --> 00:05:21,580
layer.

74
00:05:22,750 --> 00:05:25,930
Just click on train and see the result.

75
00:05:26,200 --> 00:05:27,700
Go straight to the fitting.

76
00:05:28,510 --> 00:05:30,370
Got OK.

77
00:05:30,730 --> 00:05:32,110
Here we have this line.

78
00:05:32,110 --> 00:05:32,710
This way.

79
00:05:33,610 --> 00:05:37,300
We have some errors here and it's not a very good feed here.

80
00:05:37,300 --> 00:05:40,240
Something happened which we really don't want it.

81
00:05:40,570 --> 00:05:48,910
Sometimes giving more Naranj to other network can mislead the behavior of our network.

82
00:05:48,910 --> 00:05:55,690
It's not always good to choose a very high number of neurons, but it's very important to calculate

83
00:05:55,690 --> 00:06:01,660
the correct number of neurons in each layer and then choose it based on your data.

84
00:06:02,230 --> 00:06:08,050
So let's check what will happen if I have, let's say, 20 neurons.

85
00:06:08,920 --> 00:06:11,530
Twenty neurons in our network.

86
00:06:12,580 --> 00:06:13,510
Click on train.

87
00:06:15,310 --> 00:06:16,570
Let's see what happened.

88
00:06:18,490 --> 00:06:19,750
Oh, OK.

89
00:06:19,750 --> 00:06:20,800
Here it is.

90
00:06:21,460 --> 00:06:24,760
We just ask our network to learn the pattern.

91
00:06:24,760 --> 00:06:26,980
Using twenty sigmoid.

92
00:06:27,430 --> 00:06:30,370
I'm using twenty neurons here.

93
00:06:30,370 --> 00:06:32,890
That's why it's not where we curve.

94
00:06:32,890 --> 00:06:37,720
It's not look like a sinus wave and it's not a curved line.

95
00:06:38,290 --> 00:06:45,880
It has too many facilities and it has too many activation function.

96
00:06:45,880 --> 00:06:52,090
It just calls this shape and we can say the network has been overtrained.

97
00:06:53,820 --> 00:07:02,460
Sometimes when we give too many Klip man too many facilities to an A student, the result can be negative

98
00:07:02,730 --> 00:07:07,350
and the student might be overtrain because he has too many facilities.

99
00:07:07,350 --> 00:07:12,060
It has too many men that it can cause over training.

100
00:07:12,520 --> 00:07:16,140
So it's not a very good thing to choose to many neurons.

101
00:07:16,290 --> 00:07:21,780
But the question is, how can we know what's the best number of neurons?

102
00:07:21,780 --> 00:07:23,330
Four of our head and layer.

103
00:07:23,910 --> 00:07:26,880
We already saw that in this example.

104
00:07:26,880 --> 00:07:36,690
One, Neron is not enough to Neroni is not good, treatment is good, ten is a bit too much and 20 neurons

105
00:07:36,870 --> 00:07:38,490
actually not very good.

106
00:07:38,490 --> 00:07:39,740
And this is not acceptable.

107
00:07:39,750 --> 00:07:41,900
This not look like a sign of sweet.

108
00:07:42,420 --> 00:07:49,710
It's very important to know the best number of neurons for training and network based on our samples

109
00:07:49,710 --> 00:07:51,000
and data.

110
00:07:51,600 --> 00:07:57,870
In the next session I will explain how can we calculate the best number of neurons when we want to train

111
00:07:58,050 --> 00:07:59,490
our neural network?
