0
0
Computer Visionml~10 mins

Variational Autoencoder in Computer Vision - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define the encoder input layer for a Variational Autoencoder.

Computer Vision
inputs = Input(shape=[1])
Drag options to blanks, or click blank then click option'
A(64, 64, 3)
B(32, 32, 3)
C(28, 28, 1)
D(100,)
Attempts:
3 left
💡 Hint
Common Mistakes
Using a shape with 3 channels for grayscale images.
Confusing the batch size with the input shape.
2fill in blank
medium

Complete the code to sample latent variables z using the reparameterization trick.

Computer Vision
z = [1](mean, log_var)
Drag options to blanks, or click blank then click option'
Areparametrize
Blatent_sample
Csample_latent
Dsampling
Attempts:
3 left
💡 Hint
Common Mistakes
Using a function name that is not defined in the code.
Confusing the sampling function with the encoder or decoder.
3fill in blank
hard

Fix the error in the loss function by completing the KL divergence term.

Computer Vision
kl_loss = -0.5 * K.sum(1 + [1] - K.square(mean) - K.exp(log_var), axis=-1)
Drag options to blanks, or click blank then click option'
Amean
Blog_var
Cz
Dinputs
Attempts:
3 left
💡 Hint
Common Mistakes
Using mean instead of log variance in the KL divergence term.
Using the sampled latent variable z instead of log variance.
4fill in blank
hard

Fill both blanks to complete the decoder output layer and activation function.

Computer Vision
outputs = Dense([1], activation=[2])(decoder_hidden)
Drag options to blanks, or click blank then click option'
A784
Bsigmoid
Crelu
D256
Attempts:
3 left
💡 Hint
Common Mistakes
Using relu activation in the output layer instead of sigmoid.
Setting output units to a hidden layer size instead of image size.
5fill in blank
hard

Fill all three blanks to complete the VAE model compilation with optimizer, loss, and metrics.

Computer Vision
vae.compile(optimizer=[1], loss=[2], metrics=[[3]])
Drag options to blanks, or click blank then click option'
A'adam'
Bvae_loss
C'accuracy'
D'sgd'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'sgd' optimizer which may be slower to converge.
Using a standard loss instead of the custom VAE loss.
Not including any metrics or using incorrect metric names.