I'm currently training a Convolutional Neural Network on the MNIST data set using Keras. I'm loading the data set using the format
(X_train, Y_train), (X_test, Y_test) = mnist.load_data()
But to reduce iterating through all the data, I want to select only the first 10000 samples from each class 0-9 for X_train
and similarly from Y_train
. How can I do this?