You want to compress images of size 28x28 pixels into a smaller representation and then reconstruct them. Which autoencoder architecture is best suited for this task?
Think about the type of data and which layers capture spatial features best.
Convolutional autoencoders are best for image data because convolutional layers capture spatial patterns effectively. Dense layers lose spatial information, and recurrent layers are for sequences. GANs are for generation, not compression.
Given this TensorFlow autoencoder encoder code snippet, what is the shape of the encoded output?
import tensorflow as tf encoder = tf.keras.Sequential([ tf.keras.layers.Flatten(input_shape=(28,28)), tf.keras.layers.Dense(64, activation='relu'), tf.keras.layers.Dense(32, activation='relu') ]) encoded = encoder(tf.random.uniform((10,28,28))) print(encoded.shape)
Look at the last Dense layer's output units and batch size.
The input batch size is 10. The last Dense layer outputs 32 units, so the output shape is (10, 32).
You are training an autoencoder on tabular data. What is the effect of choosing a very small latent dimension size?
Think about how much information the latent space can hold.
A very small latent dimension limits the information the model can store, causing underfitting and poor reconstruction.
Which metric is most appropriate to measure how well an autoencoder reconstructs input images?
Consider a metric that measures pixel-wise difference.
Mean Squared Error measures the average squared difference between input and reconstructed pixels, making it suitable for reconstruction quality.
You trained an autoencoder but the loss does not decrease during training. What is the most likely cause?
Check if the output layer activation matches the input data scale.
If the output layer activation is missing or not suitable (e.g., no sigmoid for data scaled 0-1), the model cannot learn proper reconstruction, causing loss to stagnate.
