Hi and welcome back.
So let's take a look at how we do the automatic bedside selection using pretty much lightning.
So it's actually quite simple.
So first thing you may notice is that we do specify about size here, and that's because in our class
definition, we do expect about size and input when our class is declared.
However, when you use the automatic selection from the trainer or tuner module in play to its lightning,
you actually don't used about, let's say you specified, actually uses about size that automatic,
but selection generates.
So let's take a look at this.
So how do we run this?
So we just to peel the Trino auto scale about size equal to true.
There's also no alternative method, which is setting to auto scale about size parameter to bin surge,
which also does a similar type search with just changes about size and powers of two to put seem to
do the same thing to me.
However, they're dead of what methods listed in the pie towards lightning documentation, so let's
run this and take a look at the output.
Woops, that's because I was messing with the other potential, I think, modules.
Sorry.
Let's run this again.
It should work now.
Yep.
So you can see it's trying to batteries for it says to succeeded.
Four succeeded.
It succeeded getting a good report.
So apparently we have enough CPU memory to use very big bad size with this.
So even though we did said the batteries are tinny too, it appears that just close this year, it appears
that we can use about size all the way up to 20000.
So I mean, I'm not entirely sure that's correct, but we'll just go with what Plato's I think says
in this ultimate selection.
And you can see it saves about sites 10th model here in this checkpoint directory, which you can check
out here.
OK, so now let's move on to the automatic learning read selection.
So you may have noticed I've read declared this class here blue.
And that's because I've made a couple of changes, so it's exactly the same could here as you've seen
up here, however, with the addition of a few lines and parameters.
So when we're doing the automatic loading which linearity selection, we do need to input the default
rate parameter in the class declaration itself.
So now we have living rate and vasos here.
As such, we have the looting written about size.
These variables, class variables here as well as we have the accuracy, trading accuracy, validation
accuracy metrics from too much metrics here that we have put in.
This is because we want to lock these things while we're trading.
They're not necessary for learning.
Read selection.
However, this is the model that we're going to use going forward to train our own model cats for model.
So I thought I would just put them in here.
So these are the names we've added here.
This is the key line here, and this is the key line.
Otherwise, there's no other changes to this code.
It's exact same thing.
We did it before so that we may have noticed this comes up quite often these little issues.
That's because sometimes CoLab you have multiple could have this notebook open in different tabs, which
I probably do right now.
Also, you will see warnings about you not being used.
Google has been a bit Google makes you a bit if you're not using a GPU because it's something it's a
resource that they don't have enough of this scarce resource and they want to reserve it for people
who are actually using it.
So we will be using it shortly, Google.
So don't bother us anymore.
So what we're going to do is we're going to set our automatic learning.
Read Tuna.
So let's run this here.
You may have noticed I have some callbacks here declared.
That's because we'll be using them shortly.
So I just and plotted them here.
However, they aren't needed for this bit of code here.
This is how we do the automatic learning read.
That's how we get it.
So let's run this.
Oh, I didn't run the code above politics.
There we go.
So this should work now it tells us that Jeep is available because we selected it.
We aren't using a TPU or IPU.
This is a.
This is a Jeep zero who would have warned you if you had multiple jeeps, you would see one and zero
had different mines so you can see your phone.
So it's selected a lifting rate of 0.1 nine, which is actually reasonably large.
However, that's what they determine to be the best loading rate given their algorithm to find the best
landing rate.
So let's see now we can actually visualize a learning rate with this lost plot here.
This is basically how the algorithm selects the best linear rate.
So let's take a look and see how it looks.
So it takes a little while to generate this graph.
Some of it is not a very exhaustive process, so we'll wait.
And if so, we can see it chooses this learning rates right here for right before the peak weight loss
goes up.
So probably you can also choose a little bit here.
Maybe that's optimized to find a bigger living read so you can reach faster convergence.
Not entirely sure how these algorithms are tuned.
However, you can dig into the documentation if you want.
These are just useful tools that you can use to get up and running faster.
So now let's begin training the model with learned about size and limit, named and learned learning
rates that we got both.
So even though we do have to specify it here, we do actually use it.
It uses the leading rates and the sizes we stored and checkpoint files here.
So let's run this, and with observed output, it's going to take a little while to trim.
However, firstly, you would notice that it is a nice print of the model.
Layers here, as well as the parameters, tells you the trainable parameters, total parameters, and
then it gives you a nice little progress buzz while training.
You can see the loss here.
One thing it doesn't show you, although it's probably configurable, is the accuracy at the end, but
we'll wait for that to see.
So lets us without one epoch and I'll take I'll mention some key points to you after.
So you can see it actually doesn't display the epochs sequentially, it overwrites the previous epoch
here and also you would have noticed that it started running the validation checks almost coming to
the end here.
And that's because it actually doesn't.
In this epoch, linked actually takes into consideration both the trading fees, as well as the execution
of the model of the validation fees as well.
So I'll leave this to run or you could as well, and then we'll move on to the Tensor boards here,
actually.
Let me move on to defensive boards right now since I already have the results of a previously trained
model here, so it's not going to make a difference to you, whether we look at this one or the previous
previous one.
So firstly, to start intensive forward in CoLab, you've got to do these run these two lines here.
So you just use this percent load on the skill extension or XY Tensor Board and then you just run the
tenths of what like this here?
Pointing to the logs are actually sort of logs of the training process that's going on here.
Remember, let's go up to the top.
We will.
Logging different validation, accuracy and validation, loss, training, accuracy, training, loss
these things during training.
So we can take a look at the results here.
So unfortunately for this tensor board here, I don't I didn't log the training accuracy.
I did it after what I forgot to update the censor board.
It will.
It will update when this model is finished training and you just rewrote the rerun.
This these lines of code.
So let's take a look at what we can see for now.
So this here, the first graph you see, the epoch graph is basically the epochs on the y axis here
with the number of steps the model takes.
So it's not a very informative graph.
It's a very linear graph, as you would expect.
But what you can see here is this is a smoothing factor, so you can see what's happening with the smoothing
if you wanted to change that as well.
So now let's take a look at training loss and elevation loss.
So you can see training loss was quite spiky.
It logs the value after every step, so that's quite cool so we can get very detailed results there.
You can see it's going down.
If you wanted to smoothen this graph to make it a bit more static, you could have done this and they
both looked quite smooth.
The validation loss as well is actually a lot smoother, and you can see the value of validation loss
going down here as well.
And you can change the horizontal axis here to the actual times it was performance.
This was in May 2021, quite a while ago, and you can see the number of steps or relative, which I'm
not sure what it changed there.
But yeah, OK.
It's just a relative exit, so you can see what was going to save one.
That's fine.
OK, cool.
So we'll stop there and we'll take a look at using callbacks in part or selecting in the next section.
So I'll see you there.
Thank you.
Hi, welcome back, this is a new addition to the video where we just wanted to introduce that, we
do have the trading accuracy here, as well as the validation accuracy of this step and per epoch.
So you can see the accuracy as it goes up to the validation.
One only trained for a few ebooks, not as much as we did before, but of 77 percent accuracy in the
training one and 82 percent accuracy.
So you can see how tens of orders are actually pretty cool.
It's a pretty useful tool to visualize the results.
And one thing I neglected to show you was that you can actually look at different versions of your training
models here, and you can visualize all of them on the same graph.
It just takes a little while to load.
Yeah.
Yeah, just this takes a little while to load these graphs, but you can see them here.
Actually, this because bush vision tree and two they actually don't exist, but if you had multiple
graphs every time you start reading, it logs one.
So I started and stopped some training instances before so I can show you those, but we can see the
one we trained here.
And you can so you can compare models.
It's quite cool, and you can actually save those check points in the log files and view them any time
intensive board.
So TensorFlow, that's quite cool.
It's a quite a good and useful tool to visualize this, and there are many others.
I use weights and biases as well with some biases.
It's actually quite good for treating things like object detectors.
So you can log multiple different training losses and look at the bounding boxes as well.
So that's it.
For now, I will stop here, and in the next section we'll take a look at callbacks, so I'll see you
there.
Thank you.