February 2020
Intermediate to advanced
328 pages
8h 19m
English
In this recipe, we will use the MNIST handwritten digit dataset. It has a training set of 60,000 examples and a test set of 10,000 examples.
We start by importing the required libraries:
library(keras)library(abind)library(grid)
Let's import the training and testing partitions of the data:
data = dataset_mnist()x_train = data$train$xx_test = data$test$xcat("Train data dimnsions",dim(x_train),"\n")cat("Test data dimnsions",dim(x_test))
In the following screenshot, we can see that the MNIST data has 60,000 train and 10,000 test images of a size of 28x28:
![]()
Let's take a look at the data of the first image:
x_train[1,,]
In the following ...
Read now
Unlock full access