March 2018
Intermediate to advanced
272 pages
7h 53m
English
The MNIST dataset consists of 60,000 hand-drawn numbers, 0 to 9. Keras provides us with a built-in loader that splits it into 50,000 training images and 10,000 test images. We will use the following code to load the dataset:
from keras.datasets import mnistdef load_data(): (X_train, _), (_, _) = mnist.load_data() X_train = (X_train.astype(np.float32) - 127.5) / 127.5 X_train = np.expand_dims(X_train, axis=3) return X_train
As you probably noticed, I'm not returning any of the labels or the testing dataset. I'm only going to use the training dataset. The labels aren't needed because the only labels I will be using are 0 for fake and 1 for real. These are real images, so they will all be assigned a label of 1 at the discriminator. ...
Read now
Unlock full access