July 2017
Intermediate to advanced
382 pages
9h 13m
English
To make sure we get the same result every time we run the experiment, we will pick a random seed for NumPy's random number generator. This way, shuffling the training samples from the MNIST dataset will always result in the same order:
In [1]: import numpy as np... np.random.seed(1337)
Keras provides a loading function similar to train_test_split from scikit-learn's model_selection module. Its syntax might look strangely familiar to you:
In [2]: from keras.datasets import mnist... (X_train, y_train), (X_test, y_test) = mnist.load_data()
Read now
Unlock full access