Hi, and welcome back to the lesson.
So now we're going to look at they just and understand and inspect it a bit and visualize it a bit.
So let's take a look at this.
So what we're using for this is the actual watch vision library, which we discussed initially in the
first video in the section and this library, you can look at it here to see what data sets it provides.
There are actually many different data sets.
They're all listed here.
A lot of these are quite famous, and the ones that we're going to use a lot are far fashion amnesty
admit, well, we don't use a machine that's in this class because it's such a huge dataset, but it's
available here, Amnesty.
And that's about it for no, maybe a couple of hours afterward.
So let's take a look at something here.
How do we import data?
How do we import data sets from using torture vision?
Well, it's actually quite simple.
You just use torch vision because we imported it up here as to what's vision.
Let's go back down.
Apologies for the scrolling.
So we have to watch mission data sets amnesty, and we just specify amnesty again here as the end.
But we set free and equal true, which means that we want to download the training dataset here.
We have downloadable true, which means that we want to download it.
Alternatively, if it's false, it would just pull it from your hard disk if you don't do that previously.
And we set the transforms equal transform.
Remember, we defined this transform right here.
So what this means here is that this trained dataset, this object that contains your dataset, also
contains information about a transform pipeline, which is really good.
It does.
It doesn't mean it's actually going to be transformed automatically.
It just means that it's going to be transformed when it passes through the PyTorch network.
It does.
That has to use this transform.
So now similarly, you can see that we physically did.
The Trinidad said, no, let's do the testing, the set and the only difference here is that we set
free and equal force.
This means that it's not going to load the test data set here.
So that's this is all fairly straightforward.
When you run the school, you'll see these download links pop up, although it shouldn't take that long
to call because it's quite fast.
The internet connection that is on collab.
So let's talk.
Let's take a look about and talk about this data.
So you see, we have two sets of data the training and the test.
You know, test data sometimes called the validation data, and it sometimes can be two different data
sets as well.
However, in principle, this is how we train neural nets or CNN's use split usually 70 percent of your
dataset into training into a training dataset, and you leave the attitude in percent as a test, or
you can split test into two groups a test and validation, as I said here.
But for no one does think of it as a 70 to 80 split.
So we set out training data to 70 percent and well, in this case, the amnesty to set it actually already
came split.
Separately, we had 60 chosen training dataset training images and 10000 test images that were training
on that.
So it's a good practice to always have the test datasets not be part of the training procedure.
The reason you have a test dataset for is because you want to train your model on one set of data and
then test it on some totally unseen data.
And that's your test dataset.
So let's inspect our detail here.
OK, so moving onto section four in this video section, because it's we can it's a short section.
She was quite short.
So let's take a look at this.
Let's inspect the scene.
So it's inspector data.
What do we do?
We just use data dot ship.
And what does that give us?
We use a trend in the set means sets that we had before, and this gives us the actual torch output
size shape.
So by specifying trend data dot ship, we can see that we have 62000 entries here Twenty-Eight by 20
each.
That's the Pixel images.
If there was a two, if this was color, you would have a confident Tree Hill to indicate that this
treat the dimension of tree.
Similarly, for the test dataset, you can see it's 10000 images, also the same wintered height twenty
eight by twenty eight.
Now, let's take a look at one sample of data so you can see by using the indexing.
Here we have data center data dot ship.
We have data open square brackets zero, which means we're going to look at the first image in the training
dataset and we can in the shape of it.
And we can see it's twenty two by twenty, which is what we expect if we take a look at the first data.
If you just move the ship and print out when the array is, you can see we get this value here.
Distances and distances of twenty by twenty odd metrics.
You can see the first row here.
Is this all zeros and you can see the middle part of where the number is?
No, you can't actually visualize it well because the lines are stacked on top of each other.
If this was a 14 by 14 image, you would actually be able to see the number written here.
That will be just values.
Anyway, we will actually visualize it now.
So let's use open KBE to talk this.
Well, we're not technically using open TV to plot it here.
We're just using the knob plot function to to to print this out.
We're just using it app the open TV to get a visit from BGR to our TV because Open TV's color scheme
is a bit different to our TV ads.
BGR, it's a minor thing, so we just convert the image to BTR and use plot that show to show this image
here.
So this is the function we often use in the previous previous opens in the U.S. to display of images
in color.
And you can see by converting this image here to inspire, we were able to pass it into this function
here and display it.
So it's a no fly, if you can see.
So that's pretty cool.
However, there are other ways we can display images from our dataset.
Yes, they are.
However, before I move on to that, I just want to tell you that whenever you need to do some of the
operations on these tenses, you can always converted to a nampai read by using dot number.
Here is also the function of by touch to convert.
The umpire is, but this is a common one that I use.
So let's take a look at another way we can plot the grips of a stack of digits like this grip so you
can see that system where we input MATLAB as party.
We do create the finger object.
We hope we see how much images we want to display here.
So 50 and what we do, we just use the supplied function here because right now we're going to be looping
from one to 51, which is 50 50 images here, and we just set the subplot here.
So this is a number of rules.
This is a number of columns.
This is the index that's going to be so it starts at one to three indexing this and start at zero and
subplots.
That's why we solve that one and we have to go to number of images plus one easily two cents to fifty
one if we wanted to be fair and removed this plus one.
And we just moved to access here to make it nice and clean, and we just plot data set here.
So by doing trends at the data and index being in the loop here, it's activated.
And look, then this is if this is going to plot the first 50 images in the dataset and we set a color
map to agree underscore our which puts a white background and black text instead of the other one we
saw here.
And this is how we get the images displayed nicely is always good practice, in my opinion.
To visualize your vision, your image data sets because you're going to find a lot of issues.
We can actually learn a lot of things and understand what types of CNN you have to use by just inspecting
the images themselves.
So it's always a good practice.
So let's stop there for now.
And in the next section, we'll take a look at creating or data what is required to know data and to
buy too much into the training mechanism, if by touch.
So I'll see you in the next section.