So now that people know that our data set.
Let's take a look at exploring and understanding or data set.
We call this inspecting our data set, which is a very good practice to do.
Here's a block of code that I wrote.
It's a very simple block of code that basically just prints the shape of the tree, and it'll set the
length of it for each one, each of the tree in and test data sets and the labels, as well as the dimensions
of one of the image samples, the shape of all the training labels as well.
So you can take a look at it here just to just as a sanity check, just to make sure everything is as
it seems.
So we know from the previous lesson that the amnesty the set has 60000 creating images, and each images
could add 28 by 28 pixels grayscale.
So you can see when we print out those things here.
Remember when we downloaded our dataset here, we actually put it in these variables already.
So Eminence Load loads this dataset and put the data in these two pools Extra and White Tree, its test
flight test, which we can access directly.
And we have it here.
So we have 60000 twenty-eight by 28 60000 samples, 60000 labels, 10000 samples, 10000 labels, dimensions
of one images, 28 by 28.
The amount of labels and extra in the 16000 which you've seen before.
Likewise for the tests and image sites.
So all that's good so far.
Now let's take a look at visualizing the data so previously in to which we did something very similar.
It's a bit easier to do in the Keros because the data the data is that we don't need to convert it into
an ideal reader to visualize it.
We can actually just simply just access random values using this random function here and using numbers
to get a random random number between zero and the length of the training dataset, which is 60000.
And we can just grab that index, pull the sample out of it here.
And that sample is an image that we can easily easily visualize using our MATLAB macho function that
we use here.
And we just use OpenCV to convert it from BGR to RGV.
And here we go.
So let's run this get some new random samples.
You can see we have seven two five five.
Oh, you can change this to any number of samples, actually.
It was at six and top this list at six.
And yeah, that's fine.
And you can actually plot these and subplots if you wanted to.
You can just have two copies of the code here, put it here and use the cell block function so you can
generate a nice block of code similar to how to which Vision does have multi plot support.
So let's take a look at doing the same thing with doing so.
Actually, some plot is done for you here.
Forgot to put us in in this lesson.
Sorry about that.
However, it's pretty cool to see.
And what I did here as well in the title you can see on top here, I put the ground truth label for
you guys.
So to see how we did this, just simply create the peeled figure, file the object, then specify the
size because we're going to it's going to be quite big.
Otherwise would have been tiny.
And because I want to see it nice and clear.
So then what we do, we did the same subplot iteration thing where we specified it was where we specify
the columns and rows.
We said the title now because we we put a random and actually we're not playing around in the index
of building the first 50 images from our training data.
We also just pulled the first 50 samples, the label sorry, and we just plot them here with the title.
We took off the axis and it's just a nice, clean image and we just show everything here and we use
a sign up to call them up to create together on black and white type.
Look.
And that's it.
That's quite simple, and it's a question I quite nice to visualize with data before training your CNN's
always good to do this, just to double check everything as a sanity check.
So I'll stop there for now.
And then I'll join you in the next section where we talk about pre-processing our data similar to how
we did the transforms and by touch intensive little Keros.
We do it slightly differently.
We have to do it a bit more manually.
But don't worry, it's quite easy stuff, so I'll see you in the next section.