Hello.
Welcome back.
So what I'm gonna do is I'm going to create a new copy of our script so that we continue from there.
I just clicked file save us for those of you who didn't see save us then I'm just going to append number
two over here.
Right.
So we have the old one saved.
Okay so what we're going to do is check out the um the dead dimension of our data set.
And by doing this we'll be able to manipulate it efficiently.
Often we make errors because we don't actually understand the the dimensions.
It happens a lot in deplaning.
So we have to take this bit very careful.
So early on we said we had to save the image as a vector a column vector and pass it through the neural
network.
This is our image our image has a red channel a green channel and a blue channel.
Right.
So if the height of the image is sixty four and a with a sixty four then we have sixty four multiplied
by sixty four.
That is for a single channel.
We multiply by three to get for the three channels.
Right.
So this is for a single image.
So now we take this.
Yeah.
And then we multiply by the number of images because of this would end up with a comment this out because
we've seen this
or simply call this test point one.
Sorry about that.
Oh continue soon for your revision.
Yeah right.
So because of this what we end up with this our image transits or rig this guy here train sets or rig
that dimension of this
the dimension of this becomes
height by with
times three.
This is for a single image height of the image times the width of the image height of the image sorry
by the width of the image by three for a single image and then number of images for the entire set.
So the number of images by the height by the width by three is the dimension of train sets X or reach.
Right.
So this the dimension this the number of images we know that for a single image we take its height with
and then it three channels for the entire image we take all of this by this in a way that is it.
So the height and weight the sense it's a square image the height and with is going to be the same.
We're going to represent the height and weight by pixel number of pixel.
So this very same thing we are going to write it like this we said we also we also mentioned that we
represent training examples by the letter M and features by index.
Right.
So this is going to be rewritten.
We are going to read writes this US M Train meaning training examples by num P X mean the number of
pixels for the height and then num P X again number of pixels for the width since it's a square image
by 3.
So this is the dimension of train set X or rake and test sets X or Rick is the same dimension except
now it becomes M test right.
So after having said this let's continue I'm going to see M Train to get M Train we say m training course
train sets or rig and then I'm gonna say shape index zero and I'm the reason I'm doing index 0 is because
I want to extract the number of training examples remember 0 gives us the number of training examples
1 give us height and then with and then OK 0 1 2 3 if I pass through here we will get a number of channels
so because I want to extract number of training examples I say it what shape index zero and train.
Okay okay I'm gonna say m test because
test set
X original dot shape index 0 right.
Once that's done you see a number of pixels you cross
we can actually yeah.
Oh just.
We can use the train set or takes it or test set Let's shape index 1.
Right.
So we we have this so we can come here and print the resort just to verify and then we can use print
off
mm mm mm mm mm mm mm.
Oh just say
no more offering examples and then I'll say plus string and all we have to do is pass M train over here
and then copy this pasted over here number of test examples and then we have to pass em test over here
and then next I can just paste this and say
image height and with and over here we pass non p x like this we can also verify the shape of the entire
training set so come over here and say print
I would just copy this.
Oh or just a train set shape.
Well we want to do is come over here and then simply SDR and then we take the shape of X train or rig
the train set X brake we take the shape
there's the X we can do the same for the y
that's what we have.
And we can verify the test sets as well.
Copy this
piece over here
and change this to test.
Okay.
Now let's see what we have control S2 safe.
Click over here.
Run module.
Yeah but indentation is this what happened here
controversy to save run module
typo
control has to save run module.
Okay so number of training examples we have two hundred and nine training examples.
Number of test examples we have 50 test examples image height and with 64.
Our image is 64 by 64.
We see over here.
The shape of the train set.
So this is number of images height with and then number of channels the shape of the training.
Why.
Because the shape of y is because we have two hundred and nine images then the shape of Y is going to
be one by two hundred and nine.
Right.
And then the test set we have 50 images for test and then the Y is 50 of them we have 50 zeros and ones
to to check what to cut or not cut.
So this is how we check this out we check the dimensions of our data sets.
If you have any questions just let me know and I'll see you in the next lesson.