# this can take several seconds, depending on internet speed.
if (FALSE) {
mnist <- read_mnist()
i <- 5
image(1:28, 1:28, matrix(mnist$test$images[i,], nrow=28)[ , 28:1],
col = gray(seq(0, 1, 0.05)), xlab = "", ylab="")
## the labels for this image is:
mnist$test$labels[i]
}
# You can download and save the data to a directory like this:
if (FALSE) {
mnist <- read_mnist(download = TRUE, destdir = "~/Downloads")
# and then, going forward, read from disk
mnist <- read_mnist("~/Downloads")
}
Run the code above in your browser using DataLab