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
From the course: Neural Networks and Convolutional Neural Networks Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Understanding the components in Keras2m 12s
-
(Locked)
Setting up a Microsoft account on Azure1m 57s
-
(Locked)
Introduction to MNIST5m 33s
-
(Locked)
Preprocessing the training data4m 38s
-
(Locked)
Preprocessing the test data1m 58s
-
(Locked)
Building the Keras model2m 23s
-
(Locked)
Compiling the neural network model2m 18s
-
(Locked)
Training the neural network model1m 27s
-
(Locked)
Accuracy and evaluation of the neural network model2m 4s
-
(Locked)
-
-
-
-
-