I would like to train a deep neural network using fewer training data samples to reduce the time for testing my code. II wanted to know how to subset the Cifar-10 dataset using Keras TensorFlow.I have the following code which is training for Cifar-10 complete dataset.
#load and prepare data
if WhichDataSet == 'CIFAR10':
(x_train, y_train), (x_test, y_test) = tensorflow.keras.datasets.cifar10.load_data()
else:
(x_train, y_train), (x_test, y_test) = tensorflow.keras.datasets.cifar100.load_data()
num_classes = np.unique(y_train).shape[0]
K_train = x_train.shape[0]
input_shape = x_train.shape[1:]
x_train = x_train.astype('float32')
x_test = x_test.astype('float32')
y_train = tensorflow.keras.utils.to_categorical(y_train, num_classes)
y_test = tensorflow.keras.utils.to_categorical(y_test, num_classes)