How? Code example
In this section we will learn the practical skills needed to perform transfer learning in TensorFlow. More specifically, we will learn how to select layers to be loaded from a checkpoint and also how to instruct our solver to optimize only specific layers while freezing the others.
TensorFlow useful elements
Since transfer learning is about training a network initialized with weights taken from another trained model, we will need to find one. In our example, we will use the encoding part of a pretrained convolutional autoencoder that was explained in chapter 6. The advantage of using an autoencoder is that we do not need labelled data, that is, it can be trained completely unsupervised.
An autoencoder without the decoder
An encoder (autoencoder without the decoder part) that consists of two convolutional layers and one fully connected layer is presented as follows. The parent autoencoder was trained on the MNIST dataset. Therefore, the network takes as input an image of size...