In this section, we will use fashion-MNIST data, specify the autoencoder model architecture, compile the model, fit the model, and then reconstruct the images. Note that fashion-MNIST is part of the Keras library.
Dimension reduction autoencoders
MNIST fashion data
We will continue to use the Keras and EBImage libraries. The code for reading the fashion-MNIST data is as follows:
# Libraries
library(keras)
library(EBImage)
# Fashion-MNIST data
mnist <- dataset_fashion_mnist()
str(mnist)
List of 2
$ train:List of 2
..$ x: int [1:60000, 1:28, 1:28] 0 0 0 0 0 0 0 0 0 0 ...
..$ y: int [1:60000(1d)] 9 0 0 3 0 2 7 2 5 5 ...
$ test :List of 2
..$ x: int [1:10000, 1:28, 1:28] 0 0 0 0 0 0 0 0 0 0 ...
..$ y: int [1:10000(1d)] 9 2...