Hello.
Welcome back.
Let's continue in this lesson we are going to perform a bit of pre processing.
We are going to reshape our image and normalize it.
Remember we've got a convert to what image to a column vector and feed it to our neural network.
This is what I want.
Your network is going to be this was going to look like this is how what image we have we would have
twelve thousand two hundred and eighty seven pixel values.
And this is arranged in the square shape or this rectangular shape and we've got three of them.
We've got to convert all of them and make them into a column vector.
And once that is done we are going to normalize it and then feed through our new to our neural network.
So we feed it to our neural network.
We come over here we perform inputs which plus bias we pass it through the red blue activation and then
the results that we get it becomes the input for the next layer.
So this the next layer.
And then we take these a values and then dot product with a weight out the bias to which is the the
second bias values that we have.
And then we pass it through our sigmoid.
This should be a sigmoid no irrelevant.
I have a typo here.
We pass it through our sigmoid activation function.
And based on what we get if the value is greater than 2.5 it's a cut if it is not then it's not a cut.
Right.
So I'm going to come over here and flatten the image meaning converted to you know a column vector
or a real vector or would it transpose or c train X on a score flatten.
This is going to be the variable to store it.
And what I'm going to do is I'm going to take green X original and then I'll C reshape
and what I'm gonna do is create X original over here dot shape
index you
and then plus minus one over here and then take the transpose of this we put at minus one here to make
the shape up the minus one makes the reshape flatten the remaining dimensions remember I selected this
dimension zero and then put minus one meaning flatten every other dimension essentially um and we want
to do it for the test sets us Well I'm gonna come down here and say test X on the score flatten course
test original
dot to reshape
and then test original dot shape index you come up minus one and then transpose like this.
Okay so once that is done we are going to take everything and normalize it because our you may just
each bit the largest value in that you make is gonna be two hundred and fifty five.
So we going to divide each item by two hundred and fifty five to perform our normalization up with some
comments here
right.
So when I say green X this what we shall put into on your network train X equals green X flatten divided
by two fifty five and then test X
you cause test X flatten divided by two hundred and fifty five like this right.
So we are done with a pre process in the next lesson we shall put together what we've pre processed
and the functions from our library to build up our model.
So I'll see you in the next.