I need to select 100 examples of each digit from MNIST database. I've tried the following code, but instead of giving me the 100 examples of 0, for example, it gives me a large integer
library(keras)
mnist <- dataset_mnist()
x_train <- mnist$train$x
y_train <- mnist$train$y
d <- x_train[sample(y_train == 0, 100, replace = FALSE)]
Can someone help me, please?