How it works...
In step 1, we initialized variables to set model parameters. The latent_dim variable sets the dimensionality of the encoded features. Then, we created an input layer of the autoencoder. In step 2, we built an encoder model. We first created convolutional layers of the encoder and then extracted the output shape of the last convolutional layer. Next, we added a flattened layer and then connected a dense layer with units equal to the latent_dim variable. In the next step, we built the decoder model. We defined an input layer for the decoder, which receives an input of a shape equal to latent_dim.
Next, we added layers in the decoder such that we reverse the operations of an encoder. In step 4, we combined encoder and decoder ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access