text_plain_output_1.png
import tensorflow as tf

i = tf.keras.Input((28, 28, 1))
x = tf.keras.layers.Conv2D(64, (3, 3), activation='relu', padding='same')(i)
x = tf.keras.layers.MaxPooling2D((2, 2), padding='same')(x)
x = tf.keras.layers.Conv2D(32, (3, 3), activation='tanh', padding='same')(x)
x = tf.keras.layers.MaxPooling2D((2, 2), padding='same')(x)
x = tf.keras.layers.Conv2DTranspose(32, (3, 3), activation='tanh', padding='same')(x)
x = tf.keras.layers.UpSampling2D((2, 2))(x)
x = tf.keras.layers.Conv2DTranspose(64, (3, 3), activation='relu', padding='same')(x)
x = tf.keras.layers.Conv2D(1, (3, 3), activation='sigmoid', padding='same')(x)
x = tf.keras.layers.UpSampling2D((2, 2))(x)
autoencoder = tf.keras.models.Model(i, x)

autoencoder.summary()