Exercises
ex-sp-ch31-01
EasyImplement the reparameterisation trick: given mu and logvar, sample z.
ex-sp-ch31-02
EasyCompute the KL divergence between N(mu, sigma^2) and N(0, 1) analytically and numerically.
ex-sp-ch31-03
EasyImplement the ELBO loss for a VAE with BCE reconstruction and Gaussian KL.
ex-sp-ch31-04
EasyCreate linear and cosine noise schedules for T=1000 steps. Plot alpha_bar_t.
ex-sp-ch31-05
EasyImplement a simple GAN discriminator for 28x28 images.
ex-sp-ch31-06
MediumTrain a VAE on MNIST and visualise latent space with 2D latent dim.
ex-sp-ch31-07
MediumImplement latent space interpolation between two images in a trained VAE.
ex-sp-ch31-08
MediumTrain a DCGAN on MNIST and generate sample images.
ex-sp-ch31-09
MediumImplement DDPM training: forward noising and noise prediction with a U-Net.
ex-sp-ch31-10
MediumImplement DDPM sampling (reverse process) and generate images from noise.
ex-sp-ch31-11
HardImplement flow matching for 2D toy data (e.g., two moons). Visualise the learned flow.
ex-sp-ch31-12
HardImplement beta-VAE and show how increasing beta disentangles latent dimensions.
ex-sp-ch31-13
HardImplement KL annealing to prevent posterior collapse in a VAE.
ex-sp-ch31-14
HardAdd spectral normalisation to a GAN discriminator and compare training stability.
ex-sp-ch31-15
ChallengeTrain a diffusion model to generate wireless channel realisations and evaluate with channel statistics.
ex-sp-ch31-16
ChallengeImplement conditional diffusion: generate channels conditioned on SNR or user location.