1
00:00:00,360 --> 00:00:01,500
Hi and welcome back.

2
00:00:02,130 --> 00:00:07,470
So let's take a look at how we do the automatic bedside selection using pretty much lightning.

3
00:00:08,070 --> 00:00:09,390
So it's actually quite simple.

4
00:00:09,420 --> 00:00:15,440
So first thing you may notice is that we do specify about size here, and that's because in our class

5
00:00:15,450 --> 00:00:19,980
definition, we do expect about size and input when our class is declared.

6
00:00:20,610 --> 00:00:27,450
However, when you use the automatic selection from the trainer or tuner module in play to its lightning,

7
00:00:28,080 --> 00:00:33,930
you actually don't used about, let's say you specified, actually uses about size that automatic,

8
00:00:33,930 --> 00:00:35,700
but selection generates.

9
00:00:35,850 --> 00:00:36,990
So let's take a look at this.

10
00:00:36,990 --> 00:00:38,220
So how do we run this?

11
00:00:38,220 --> 00:00:44,130
So we just to peel the Trino auto scale about size equal to true.

12
00:00:44,670 --> 00:00:51,270
There's also no alternative method, which is setting to auto scale about size parameter to bin surge,

13
00:00:51,360 --> 00:00:56,970
which also does a similar type search with just changes about size and powers of two to put seem to

14
00:00:56,970 --> 00:00:58,060
do the same thing to me.

15
00:00:58,080 --> 00:01:03,780
However, they're dead of what methods listed in the pie towards lightning documentation, so let's

16
00:01:03,780 --> 00:01:06,810
run this and take a look at the output.

17
00:01:09,450 --> 00:01:13,620
Woops, that's because I was messing with the other potential, I think, modules.

18
00:01:13,800 --> 00:01:14,250
Sorry.

19
00:01:14,820 --> 00:01:15,750
Let's run this again.

20
00:01:15,750 --> 00:01:16,680
It should work now.

21
00:01:18,720 --> 00:01:19,020
Yep.

22
00:01:19,020 --> 00:01:23,310
So you can see it's trying to batteries for it says to succeeded.

23
00:01:23,310 --> 00:01:24,010
Four succeeded.

24
00:01:24,030 --> 00:01:26,640
It succeeded getting a good report.

25
00:01:26,850 --> 00:01:33,120
So apparently we have enough CPU memory to use very big bad size with this.

26
00:01:33,720 --> 00:01:41,250
So even though we did said the batteries are tinny too, it appears that just close this year, it appears

27
00:01:41,250 --> 00:01:44,370
that we can use about size all the way up to 20000.

28
00:01:44,910 --> 00:01:51,300
So I mean, I'm not entirely sure that's correct, but we'll just go with what Plato's I think says

29
00:01:51,300 --> 00:01:52,620
in this ultimate selection.

30
00:01:53,040 --> 00:01:59,880
And you can see it saves about sites 10th model here in this checkpoint directory, which you can check

31
00:01:59,880 --> 00:02:01,770
out here.

32
00:02:02,820 --> 00:02:07,110
OK, so now let's move on to the automatic learning read selection.

33
00:02:07,650 --> 00:02:11,310
So you may have noticed I've read declared this class here blue.

34
00:02:11,850 --> 00:02:17,880
And that's because I've made a couple of changes, so it's exactly the same could here as you've seen

35
00:02:17,880 --> 00:02:21,240
up here, however, with the addition of a few lines and parameters.

36
00:02:21,240 --> 00:02:27,520
So when we're doing the automatic loading which linearity selection, we do need to input the default

37
00:02:27,750 --> 00:02:30,720
rate parameter in the class declaration itself.

38
00:02:31,200 --> 00:02:33,570
So now we have living rate and vasos here.

39
00:02:34,470 --> 00:02:36,660
As such, we have the looting written about size.

40
00:02:37,170 --> 00:02:43,110
These variables, class variables here as well as we have the accuracy, trading accuracy, validation

41
00:02:43,110 --> 00:02:46,800
accuracy metrics from too much metrics here that we have put in.

42
00:02:47,280 --> 00:02:49,710
This is because we want to lock these things while we're trading.

43
00:02:49,710 --> 00:02:51,180
They're not necessary for learning.

44
00:02:51,180 --> 00:02:52,170
Read selection.

45
00:02:52,650 --> 00:02:59,190
However, this is the model that we're going to use going forward to train our own model cats for model.

46
00:02:59,700 --> 00:03:01,680
So I thought I would just put them in here.

47
00:03:01,680 --> 00:03:03,480
So these are the names we've added here.

48
00:03:03,960 --> 00:03:06,510
This is the key line here, and this is the key line.

49
00:03:06,990 --> 00:03:10,140
Otherwise, there's no other changes to this code.

50
00:03:10,140 --> 00:03:11,070
It's exact same thing.

51
00:03:11,070 --> 00:03:18,270
We did it before so that we may have noticed this comes up quite often these little issues.

52
00:03:18,720 --> 00:03:23,310
That's because sometimes CoLab you have multiple could have this notebook open in different tabs, which

53
00:03:23,310 --> 00:03:24,720
I probably do right now.

54
00:03:25,170 --> 00:03:28,320
Also, you will see warnings about you not being used.

55
00:03:28,830 --> 00:03:34,350
Google has been a bit Google makes you a bit if you're not using a GPU because it's something it's a

56
00:03:34,350 --> 00:03:39,540
resource that they don't have enough of this scarce resource and they want to reserve it for people

57
00:03:39,540 --> 00:03:40,680
who are actually using it.

58
00:03:40,740 --> 00:03:42,510
So we will be using it shortly, Google.

59
00:03:42,990 --> 00:03:45,300
So don't bother us anymore.

60
00:03:45,810 --> 00:03:49,350
So what we're going to do is we're going to set our automatic learning.

61
00:03:49,350 --> 00:03:49,950
Read Tuna.

62
00:03:50,190 --> 00:03:51,750
So let's run this here.

63
00:03:52,470 --> 00:03:55,050
You may have noticed I have some callbacks here declared.

64
00:03:55,500 --> 00:03:57,210
That's because we'll be using them shortly.

65
00:03:57,220 --> 00:03:59,040
So I just and plotted them here.

66
00:03:59,070 --> 00:04:02,620
However, they aren't needed for this bit of code here.

67
00:04:02,640 --> 00:04:05,400
This is how we do the automatic learning read.

68
00:04:05,400 --> 00:04:06,180
That's how we get it.

69
00:04:06,420 --> 00:04:07,500
So let's run this.

70
00:04:08,130 --> 00:04:10,470
Oh, I didn't run the code above politics.

71
00:04:13,160 --> 00:04:13,640
There we go.

72
00:04:14,600 --> 00:04:19,490
So this should work now it tells us that Jeep is available because we selected it.

73
00:04:19,550 --> 00:04:21,980
We aren't using a TPU or IPU.

74
00:04:22,580 --> 00:04:22,970
This is a.

75
00:04:23,570 --> 00:04:29,240
This is a Jeep zero who would have warned you if you had multiple jeeps, you would see one and zero

76
00:04:29,240 --> 00:04:32,090
had different mines so you can see your phone.

77
00:04:32,210 --> 00:04:36,560
So it's selected a lifting rate of 0.1 nine, which is actually reasonably large.

78
00:04:37,070 --> 00:04:42,440
However, that's what they determine to be the best loading rate given their algorithm to find the best

79
00:04:42,440 --> 00:04:43,010
landing rate.

80
00:04:43,160 --> 00:04:49,400
So let's see now we can actually visualize a learning rate with this lost plot here.

81
00:04:49,880 --> 00:04:54,110
This is basically how the algorithm selects the best linear rate.

82
00:04:54,770 --> 00:04:57,350
So let's take a look and see how it looks.

83
00:04:59,780 --> 00:05:01,910
So it takes a little while to generate this graph.

84
00:05:02,480 --> 00:05:06,830
Some of it is not a very exhaustive process, so we'll wait.

85
00:05:08,510 --> 00:05:14,870
And if so, we can see it chooses this learning rates right here for right before the peak weight loss

86
00:05:14,870 --> 00:05:15,320
goes up.

87
00:05:15,740 --> 00:05:19,210
So probably you can also choose a little bit here.

88
00:05:19,230 --> 00:05:23,220
Maybe that's optimized to find a bigger living read so you can reach faster convergence.

89
00:05:23,870 --> 00:05:27,430
Not entirely sure how these algorithms are tuned.

90
00:05:27,470 --> 00:05:30,620
However, you can dig into the documentation if you want.

91
00:05:30,680 --> 00:05:35,270
These are just useful tools that you can use to get up and running faster.

92
00:05:36,050 --> 00:05:41,510
So now let's begin training the model with learned about size and limit, named and learned learning

93
00:05:41,510 --> 00:05:43,790
rates that we got both.

94
00:05:44,090 --> 00:05:48,010
So even though we do have to specify it here, we do actually use it.

95
00:05:48,020 --> 00:05:51,680
It uses the leading rates and the sizes we stored and checkpoint files here.

96
00:05:52,400 --> 00:05:58,190
So let's run this, and with observed output, it's going to take a little while to trim.

97
00:05:58,730 --> 00:06:04,280
However, firstly, you would notice that it is a nice print of the model.

98
00:06:04,970 --> 00:06:10,400
Layers here, as well as the parameters, tells you the trainable parameters, total parameters, and

99
00:06:10,400 --> 00:06:15,450
then it gives you a nice little progress buzz while training.

100
00:06:15,680 --> 00:06:17,880
You can see the loss here.

101
00:06:17,900 --> 00:06:23,930
One thing it doesn't show you, although it's probably configurable, is the accuracy at the end, but

102
00:06:23,930 --> 00:06:25,190
we'll wait for that to see.

103
00:06:25,790 --> 00:06:32,360
So lets us without one epoch and I'll take I'll mention some key points to you after.

104
00:06:34,680 --> 00:06:39,690
So you can see it actually doesn't display the epochs sequentially, it overwrites the previous epoch

105
00:06:39,690 --> 00:06:45,750
here and also you would have noticed that it started running the validation checks almost coming to

106
00:06:45,750 --> 00:06:46,430
the end here.

107
00:06:46,440 --> 00:06:48,300
And that's because it actually doesn't.

108
00:06:48,360 --> 00:06:55,050
In this epoch, linked actually takes into consideration both the trading fees, as well as the execution

109
00:06:55,050 --> 00:06:57,510
of the model of the validation fees as well.

110
00:06:58,260 --> 00:07:04,200
So I'll leave this to run or you could as well, and then we'll move on to the Tensor boards here,

111
00:07:04,200 --> 00:07:04,710
actually.

112
00:07:05,250 --> 00:07:09,540
Let me move on to defensive boards right now since I already have the results of a previously trained

113
00:07:09,540 --> 00:07:14,670
model here, so it's not going to make a difference to you, whether we look at this one or the previous

114
00:07:14,940 --> 00:07:15,600
previous one.

115
00:07:17,100 --> 00:07:23,340
So firstly, to start intensive forward in CoLab, you've got to do these run these two lines here.

116
00:07:23,550 --> 00:07:31,170
So you just use this percent load on the skill extension or XY Tensor Board and then you just run the

117
00:07:31,170 --> 00:07:32,370
tenths of what like this here?

118
00:07:32,370 --> 00:07:37,050
Pointing to the logs are actually sort of logs of the training process that's going on here.

119
00:07:37,530 --> 00:07:39,300
Remember, let's go up to the top.

120
00:07:39,810 --> 00:07:40,380
We will.

121
00:07:40,380 --> 00:07:46,440
Logging different validation, accuracy and validation, loss, training, accuracy, training, loss

122
00:07:46,440 --> 00:07:47,820
these things during training.

123
00:07:48,330 --> 00:07:50,970
So we can take a look at the results here.

124
00:07:51,330 --> 00:07:58,350
So unfortunately for this tensor board here, I don't I didn't log the training accuracy.

125
00:07:58,350 --> 00:08:01,770
I did it after what I forgot to update the censor board.

126
00:08:02,160 --> 00:08:02,550
It will.

127
00:08:02,640 --> 00:08:08,070
It will update when this model is finished training and you just rewrote the rerun.

128
00:08:08,070 --> 00:08:09,390
This these lines of code.

129
00:08:10,230 --> 00:08:12,480
So let's take a look at what we can see for now.

130
00:08:12,960 --> 00:08:20,940
So this here, the first graph you see, the epoch graph is basically the epochs on the y axis here

131
00:08:21,360 --> 00:08:23,340
with the number of steps the model takes.

132
00:08:23,340 --> 00:08:25,140
So it's not a very informative graph.

133
00:08:25,260 --> 00:08:27,300
It's a very linear graph, as you would expect.

134
00:08:28,320 --> 00:08:33,630
But what you can see here is this is a smoothing factor, so you can see what's happening with the smoothing

135
00:08:33,630 --> 00:08:35,850
if you wanted to change that as well.

136
00:08:36,420 --> 00:08:41,850
So now let's take a look at training loss and elevation loss.

137
00:08:42,600 --> 00:08:44,790
So you can see training loss was quite spiky.

138
00:08:45,150 --> 00:08:50,670
It logs the value after every step, so that's quite cool so we can get very detailed results there.

139
00:08:51,240 --> 00:08:52,650
You can see it's going down.

140
00:08:52,650 --> 00:08:58,620
If you wanted to smoothen this graph to make it a bit more static, you could have done this and they

141
00:08:58,620 --> 00:08:59,850
both looked quite smooth.

142
00:09:00,210 --> 00:09:06,660
The validation loss as well is actually a lot smoother, and you can see the value of validation loss

143
00:09:06,660 --> 00:09:07,870
going down here as well.

144
00:09:08,340 --> 00:09:13,350
And you can change the horizontal axis here to the actual times it was performance.

145
00:09:13,350 --> 00:09:20,490
This was in May 2021, quite a while ago, and you can see the number of steps or relative, which I'm

146
00:09:20,490 --> 00:09:22,410
not sure what it changed there.

147
00:09:22,710 --> 00:09:25,210
But yeah, OK.

148
00:09:25,230 --> 00:09:27,470
It's just a relative exit, so you can see what was going to save one.

149
00:09:28,120 --> 00:09:28,680
That's fine.

150
00:09:28,830 --> 00:09:29,610
OK, cool.

151
00:09:30,240 --> 00:09:37,200
So we'll stop there and we'll take a look at using callbacks in part or selecting in the next section.

152
00:09:37,260 --> 00:09:38,460
So I'll see you there.

153
00:09:38,580 --> 00:09:39,030
Thank you.

154
00:09:41,290 --> 00:09:46,960
Hi, welcome back, this is a new addition to the video where we just wanted to introduce that, we

155
00:09:46,960 --> 00:09:53,320
do have the trading accuracy here, as well as the validation accuracy of this step and per epoch.

156
00:09:53,680 --> 00:09:57,010
So you can see the accuracy as it goes up to the validation.

157
00:09:57,010 --> 00:10:03,760
One only trained for a few ebooks, not as much as we did before, but of 77 percent accuracy in the

158
00:10:03,760 --> 00:10:06,520
training one and 82 percent accuracy.

159
00:10:07,030 --> 00:10:09,530
So you can see how tens of orders are actually pretty cool.

160
00:10:09,550 --> 00:10:11,710
It's a pretty useful tool to visualize the results.

161
00:10:12,160 --> 00:10:17,650
And one thing I neglected to show you was that you can actually look at different versions of your training

162
00:10:17,650 --> 00:10:20,890
models here, and you can visualize all of them on the same graph.

163
00:10:20,890 --> 00:10:23,950
It just takes a little while to load.

164
00:10:24,160 --> 00:10:24,460
Yeah.

165
00:10:30,500 --> 00:10:34,190
Yeah, just this takes a little while to load these graphs, but you can see them here.

166
00:10:34,220 --> 00:10:39,110
Actually, this because bush vision tree and two they actually don't exist, but if you had multiple

167
00:10:39,110 --> 00:10:42,020
graphs every time you start reading, it logs one.

168
00:10:42,020 --> 00:10:47,420
So I started and stopped some training instances before so I can show you those, but we can see the

169
00:10:47,420 --> 00:10:48,470
one we trained here.

170
00:10:48,500 --> 00:10:50,930
And you can so you can compare models.

171
00:10:51,410 --> 00:10:56,960
It's quite cool, and you can actually save those check points in the log files and view them any time

172
00:10:56,960 --> 00:10:57,860
intensive board.

173
00:10:57,890 --> 00:10:59,300
So TensorFlow, that's quite cool.

174
00:11:00,620 --> 00:11:04,310
It's a quite a good and useful tool to visualize this, and there are many others.

175
00:11:04,340 --> 00:11:06,490
I use weights and biases as well with some biases.

176
00:11:06,500 --> 00:11:10,340
It's actually quite good for treating things like object detectors.

177
00:11:10,370 --> 00:11:15,410
So you can log multiple different training losses and look at the bounding boxes as well.

178
00:11:15,950 --> 00:11:17,000
So that's it.

179
00:11:17,000 --> 00:11:22,910
For now, I will stop here, and in the next section we'll take a look at callbacks, so I'll see you

180
00:11:22,910 --> 00:11:23,180
there.

181
00:11:23,270 --> 00:11:23,660
Thank you.
