I want to use a portion randomly from the MNIST dataset. Can you help me please? Now the output shape (i.e. Out
) is 60000 but I want to get about 2000:
import matplotlib.pyplot as plt
from keras.datasets import mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_train.reshape(60000, 784) / 255
x_test = x_test.reshape(10000, 784) / 255
x_train.shape # Out: (60000, 748)