Training and evaluation of an AE
We mentioned AEs in Chapter 7 when we discussed the process of feature engineering for images. AEs, however, are used to do much more than just image feature extraction. One of the major aspects of them is to be able to recreate images. This means that we can create images based on the placement of the image in the latent space.
So, let us train the AE model for a dataset that is pretty standard in ML – Fashion MNIST. We got to see what the dataset looks like in our previous chapters. We start our training by preparing the data in the following code fragment:
# Transforms images to a PyTorch Tensor tensor_transform = transforms.ToTensor() # Download the Fashion MNIST Dataset dataset = datasets.FashionMNIST(root = "./data", train = True, ...