Implementing autoencoders with TensorFlow 2