From the course: Neural Networks and Convolutional Neural Networks Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Preprocessing the training data

Preprocessing the training data

From the course: Neural Networks and Convolutional Neural Networks Essential Training

Start my 1-month free trial

Preprocessing the training data

- [Instructor] So let's try and understand what our data looks like. Now if we looked at the first element in the first numpy array, and see what shape it is, so the first element would be x_train, and the first element would be the zeroth element. If we look at the shape, we see that it's an image with dimensions 28 by 28. So why don't we plot this to see which digit this is? So let's use Mathplotlib to help us here, so plt.imshow, and we want the first element, so x-train 0, and we want a color map of gray. And we can see that in the first element of our x_train data set, we have an image, which is five. So we would expect the corresponding y_train element for the first element to be a five. And so... We can confirm that that is in fact the case. Now let's look at pre-processing our image data. So let's set the image height and image width variables as being of size 28 and 28. So I run that cell by hitting Shift and Enter. And if we wanted to use this as our input to our neural…

Contents