🌍 Deep Learning · subject

Deep Learning Generative Deep Learning Syllabus

The Generative Deep Learning syllabus for Deep Learning in full: 4 chapters and 11 topics, every one listed below, plus 50 Generative Deep Learning flashcards with answers.

4Chapters
11Topics
50Flashcards

Generative Deep Learning syllabus: all 4 chapters

Expand any chapter to see its topics and sub-topics.

  1. Autoencoders

    2 topics
    • Vanilla and Denoising Autoencoders
    • Variational Autoencoders
  2. Generative Adversarial Networks

    3 topics
    • GAN Framework
    • Training Instability and Mode Collapse
    • DCGAN, StyleGAN, CycleGAN
  3. Diffusion Models

    4 topics
    • Denoising Diffusion Probabilistic Models
    • Latent Diffusion and Stable Diffusion
    • Classifier-Free Guidance
    • Text-to-Image Generation
  4. Autoregressive Generation

    2 topics
    • PixelRNN and PixelCNN
    • Sampling Strategies (Top-k, Top-p, Temperature)

Deep Learning Generative Deep Learning flashcards — 50 questions with answers

  1. What is the core objective of a vanilla autoencoder?

    To learn a compressed latent representation by training an encoder $f$ and decoder $g$ to reconstruct the input, minimizing a reconstruction loss such as $\mathcal{L} = \lVert x - g(f(x)) \rVert^{2}$. The bottleneck layer forces the network to capture the most salient features.

  2. How does a denoising autoencoder (DAE) differ from a vanilla autoencoder?

    A DAE corrupts the input to $\tilde{x}$ (e.g., adding Gaussian noise or masking) and trains the network to reconstruct the clean original: $\mathcal{L} = \lVert x - g(f(\tilde{x})) \rVert^{2}$. This prevents learning the identity function and yields more robust features.

  3. Why is a plain autoencoder generally a poor generative model?

    Its latent space is not regularized to any known prior distribution, so it has 'holes' and discontinuities. Sampling arbitrary latent points and decoding them typically produces unrealistic outputs, so you cannot reliably generate new samples.

  4. What two terms make up the Variational Autoencoder (VAE) loss (ELBO)?

    A reconstruction term and a KL-divergence regularizer: $$\mathcal{L} = \mathbb{E}_{q(z|x)}[\log p(x|z)] - D_{KL}\!\big(q(z|x)\,\Vert\,p(z)\big),$$ where the ELBO is maximized (or its negative minimized).

  5. What prior distribution does a standard VAE assume over the latent variable $z$?

    An isotropic standard Gaussian, $p(z) = \mathcal{N}(0, I)$. The KL term pushes the approximate posterior $q(z|x)$ toward this prior.

  6. What is the reparameterization trick in a VAE and why is it needed?

    It rewrites the sampled latent as $z = \mu + \sigma \odot \epsilon$ with $\epsilon \sim \mathcal{N}(0, I)$, moving the stochasticity to $\epsilon$. This makes $z$ a deterministic differentiable function of $\mu$ and $\sigma$, allowing gradients to backpropagate through the sampling step.

  7. What does the encoder of a VAE output?

    The parameters of the approximate posterior $q(z|x)$ — typically the mean vector $\mu$ and log-variance $\log \sigma^{2}$ of a diagonal Gaussian — rather than a single deterministic code.

  8. Write the closed-form KL divergence between $q(z|x)=\mathcal{N}(\mu,\sigma^{2})$ and $p(z)=\mathcal{N}(0,I)$.

    $$D_{KL} = -\tfrac{1}{2} \sum_{j=1}^{d} \big(1 + \log \sigma_{j}^{2} - \mu_{j}^{2} - \sigma_{j}^{2}\big).$$

  9. What is 'posterior collapse' in VAEs?

    When the decoder becomes powerful enough to ignore $z$, driving $q(z|x)$ to match the prior $p(z)$ so the KL term vanishes and the latent code carries no information about the input. The model then reconstructs from the decoder alone.

  10. What is the role of the $\beta$ hyperparameter in a $\beta$-VAE?

    It scales the KL term, $\mathcal{L} = \text{recon} + \beta \, D_{KL}$. Setting $\beta > 1$ increases pressure toward the prior, encouraging more disentangled latent factors at the cost of reconstruction fidelity.

  11. Describe the two-player game in the GAN framework.

    A generator $G$ maps noise $z$ to fake samples, while a discriminator $D$ estimates the probability a sample is real. They play a minimax game: $G$ tries to fool $D$, and $D$ tries to distinguish real from generated data.

  12. State the original GAN minimax objective.

    $$\min_{G} \max_{D} \; \mathbb{E}_{x \sim p_{data}}[\log D(x)] + \mathbb{E}_{z \sim p_{z}}[\log (1 - D(G(z)))].$$

  13. At the theoretical optimum of a GAN, what is the discriminator's output and the generator's distribution?

    The optimal discriminator is $D^{*}(x) = \dfrac{p_{data}(x)}{p_{data}(x) + p_{g}(x)} = \tfrac{1}{2}$ when $p_{g} = p_{data}$. At convergence the generator distribution equals the data distribution and $D$ outputs $\tfrac{1}{2}$ everywhere.

  14. What is the 'non-saturating' generator loss and why is it used?

    Instead of minimizing $\log(1 - D(G(z)))$, the generator maximizes $\log D(G(z))$ (equivalently minimizes $-\log D(G(z))$). This provides stronger, non-vanishing gradients early in training when $D$ easily rejects fakes.

  15. What divergence does the original GAN objective minimize between $p_{data}$ and $p_{g}$?

    The Jensen–Shannon divergence, $JSD(p_{data} \Vert p_{g})$, up to constants when the discriminator is optimal.

  16. What is mode collapse in GAN training?

    When the generator produces only a small set of very similar outputs, ignoring the diversity of the data distribution. It maps many latent inputs to a few 'safe' modes that fool the current discriminator.

  17. Name three common causes or symptoms of GAN training instability.

    Vanishing gradients (discriminator too strong), mode collapse (generator diversity loss), and oscillation/non-convergence where $G$ and $D$ chase each other without reaching equilibrium.

  18. How does the Wasserstein GAN (WGAN) improve stability over the original GAN?

    It minimizes the Earth-Mover (Wasserstein-1) distance instead of JS divergence, giving smoother gradients even when distributions do not overlap. The critic outputs an unbounded score and must be Lipschitz-constrained (via weight clipping or a gradient penalty).

  19. What is the gradient penalty in WGAN-GP and what does it enforce?

    A term $\lambda \, \mathbb{E}_{\hat{x}}\big[(\lVert \nabla_{\hat{x}} D(\hat{x}) \rVert_{2} - 1)^{2}\big]$ added to the critic loss, enforcing the 1-Lipschitz constraint by penalizing gradient norms that deviate from 1 on interpolated samples $\hat{x}$.

  20. List key architectural guidelines introduced by DCGAN.

    Replace pooling with strided convolutions (discriminator) and fractional-strided/transposed convolutions (generator); use batch normalization in both networks; remove fully connected hidden layers; use ReLU in the generator (Tanh at output) and LeakyReLU in the discriminator.

Show the other 30 Generative Deep Learning flashcards
  1. What is the central architectural innovation of StyleGAN?

    A style-based generator: a mapping network transforms $z$ into an intermediate latent $w$, which controls each layer's feature statistics via Adaptive Instance Normalization (AdaIN). This disentangles high-level attributes and enables fine-grained, scale-specific style control.

  2. What is AdaIN in StyleGAN and its formula?

    Adaptive Instance Normalization injects style by normalizing each feature map and rescaling with style-derived parameters: $$\text{AdaIN}(x_{i}, y) = y_{s,i}\,\frac{x_{i} - \mu(x_{i})}{\sigma(x_{i})} + y_{b,i},$$ where $y_{s}$ and $y_{b}$ come from the style vector $w$.

  3. What problem does CycleGAN solve and what is its key loss?

    Unpaired image-to-image translation between two domains. Its key component is the cycle-consistency loss: translating $X \to Y \to X$ (and vice versa) should recover the original, $\lVert F(G(x)) - x \rVert_{1}$, ensuring content preservation without paired data.

  4. Why does CycleGAN use two generators and two discriminators?

    It learns mappings in both directions, $G: X \to Y$ and $F: Y \to X$, each paired with a discriminator ($D_{Y}$, $D_{X}$). The two adversarial losses plus the cycle-consistency loss enforce realistic and content-preserving bidirectional translation.

  5. What are the two processes that define a Denoising Diffusion Probabilistic Model (DDPM)?

    A fixed forward (diffusion) process that gradually adds Gaussian noise to data over $T$ steps until it becomes pure noise, and a learned reverse process that denoises step by step to generate samples.

  6. Write the DDPM forward transition for a single step.

    $$q(x_{t} \mid x_{t-1}) = \mathcal{N}\!\big(x_{t};\, \sqrt{1 - \beta_{t}}\, x_{t-1},\, \beta_{t} I\big),$$ where $\beta_{t}$ is the variance schedule at step $t$.

  7. Give the closed-form for sampling $x_{t}$ directly from $x_{0}$ in DDPM.

    $$x_{t} = \sqrt{\bar{\alpha}_{t}}\, x_{0} + \sqrt{1 - \bar{\alpha}_{t}}\, \epsilon, \quad \epsilon \sim \mathcal{N}(0, I),$$ where $\alpha_{t} = 1 - \beta_{t}$ and $\bar{\alpha}_{t} = \prod_{s=1}^{t} \alpha_{s}$.

  8. What is the simplified DDPM training objective?

    A noise-prediction MSE: $$\mathcal{L}_{simple} = \mathbb{E}_{t, x_{0}, \epsilon}\Big[\big\lVert \epsilon - \epsilon_{\theta}(x_{t}, t) \big\rVert^{2}\Big],$$ where the network $\epsilon_{\theta}$ predicts the noise added at step $t$.

  9. What neural network architecture is typically used to parameterize the DDPM reverse process?

    A U-Net with residual blocks, self-attention layers, and a sinusoidal time-step embedding, which predicts the noise $\epsilon_{\theta}(x_{t}, t)$ (or the denoised mean) at each diffusion step.

  10. How does Latent Diffusion (LDM) reduce the cost of diffusion models?

    It runs the diffusion process in a compressed latent space produced by a pretrained autoencoder (encoder/decoder), rather than on high-resolution pixels. This drastically cuts computation while preserving perceptual quality, since the latent space is lower-dimensional.

  11. What are the main components of Stable Diffusion?

    A VAE encoder/decoder (pixel↔latent), a U-Net denoiser operating in latent space, and a text encoder (e.g., a CLIP text model) whose embeddings condition the U-Net via cross-attention.

  12. How is text conditioning injected into the Stable Diffusion U-Net?

    Via cross-attention layers, where the text-embedding sequence provides the keys and values and the U-Net's spatial features provide the queries, letting the prompt guide denoising at each resolution.

  13. What is classifier guidance in diffusion models?

    Using the gradient of a separately trained classifier $p(y|x_{t})$ to steer sampling toward class $y$: the score is modified as $\nabla_{x} \log p(x_{t}) + s\,\nabla_{x} \log p(y|x_{t})$, where $s$ is the guidance scale. It requires an extra noise-robust classifier.

  14. What is classifier-free guidance (CFG) and its main advantage?

    A technique that trains a single conditional model which sometimes drops the condition (null token), then at sampling combines conditional and unconditional predictions. It avoids needing a separate classifier while still allowing controllable conditioning strength.

  15. Write the classifier-free guidance formula for the predicted noise.

    $$\tilde{\epsilon}_{\theta}(x_{t}, c) = \epsilon_{\theta}(x_{t}, \varnothing) + w\,\big(\epsilon_{\theta}(x_{t}, c) - \epsilon_{\theta}(x_{t}, \varnothing)\big),$$ where $c$ is the conditioning, $\varnothing$ the null condition, and $w$ the guidance scale.

  16. How does the guidance scale $w$ affect classifier-free guidance outputs?

    Higher $w$ increases adherence to the prompt/condition and sample fidelity but reduces diversity and can cause oversaturation or artifacts; $w = 1$ recovers ordinary conditional sampling, and $w = 0$ gives unconditional generation.

  17. How is the unconditional model obtained in classifier-free guidance training?

    By randomly replacing the conditioning $c$ with a null/empty token for a fraction of training examples (e.g., 10–20%), so the same network learns both conditional $\epsilon_{\theta}(x_t, c)$ and unconditional $\epsilon_{\theta}(x_t, \varnothing)$ predictions.

  18. What role does a CLIP text encoder play in text-to-image models?

    It converts the text prompt into semantically rich embeddings aligned with visual concepts; these embeddings condition the generator (via cross-attention) so that produced images match the described content.

  19. How does DALL·E 2 (unCLIP) use CLIP for text-to-image generation?

    A prior maps a CLIP text embedding to a CLIP image embedding, and a diffusion decoder generates the image conditioned on that image embedding. This two-stage design leverages CLIP's shared text–image latent space.

  20. What is the core autoregressive assumption of PixelRNN and PixelCNN?

    They model an image as a product of per-pixel conditionals in raster-scan order: $$p(x) = \prod_{i=1}^{n} p(x_{i} \mid x_{1}, \dots, x_{i-1}),$$ generating each pixel conditioned on all previously generated pixels.

  21. What is the key difference between PixelRNN and PixelCNN?

    PixelRNN uses recurrent layers (Row/Diagonal LSTM) to capture pixel dependencies, giving a broad receptive field but slow sequential training. PixelCNN uses masked convolutions, enabling parallel training but with a more limited (blind-spot-prone) receptive field.

  22. Why are masked convolutions needed in PixelCNN?

    To preserve the autoregressive property: the mask zeroes out access to the current and future pixels so each output depends only on already-generated pixels above and to the left, preventing information leakage from the pixel being predicted.

  23. What is the 'blind spot' problem in PixelCNN, and how is it addressed?

    Stacked masked convolutions fail to cover some context pixels, creating a blind spot in the receptive field. Gated PixelCNN fixes it by combining separate vertical and horizontal convolutional stacks so the full preceding context is captured.

  24. How does PixelCNN model the distribution of a pixel's color value?

    As a discrete categorical (softmax) distribution over the 256 possible intensity values per channel (or via a discretized mixture of logistics in PixelCNN++), trained with a cross-entropy/negative-log-likelihood loss.

  25. Contrast training speed vs. sampling speed for autoregressive pixel models.

    PixelCNN trains efficiently in parallel (all conditionals computed at once with teacher forcing), but sampling is inherently sequential — each pixel must be generated one at a time — making generation slow, on the order of $O(n)$ forward passes for $n$ pixels.

  26. What does temperature $\tau$ do when sampling from a softmax output?

    It rescales logits before softmax: $p_{i} = \dfrac{\exp(z_{i}/\tau)}{\sum_{j} \exp(z_{j}/\tau)}$. Lower $\tau$ (<1) sharpens the distribution (more deterministic/confident), while higher $\tau$ (>1) flattens it (more random/diverse).

  27. Describe top-k sampling.

    At each step, keep only the $k$ tokens with the highest probability, renormalize their probabilities to sum to 1, and sample from that truncated set. This blocks low-probability tokens while retaining some randomness.

  28. Describe top-p (nucleus) sampling and how it differs from top-k.

    Top-p keeps the smallest set of tokens whose cumulative probability exceeds a threshold $p$ (the nucleus), then samples from it. Unlike fixed-size top-k, the candidate set size adapts to the distribution's shape — small when the model is confident, larger when uncertain.

  29. Compare greedy decoding with sampling-based strategies.

    Greedy decoding always picks the highest-probability token, yielding deterministic but often repetitive, low-diversity output. Sampling (with temperature, top-k, or top-p) injects controlled randomness for more diverse and creative generations at some cost to reliability.

  30. Rank VAEs, GANs, and diffusion models on sample quality vs. training stability.

    Sample quality: diffusion $\gtrsim$ GANs $>$ VAEs (VAEs tend to be blurry). Training stability: diffusion and VAEs are stable and have well-defined likelihood-based objectives, whereas GANs are adversarial and prone to mode collapse and instability. Diffusion's main drawback is slow, multi-step sampling.

Deep Learning Generative Deep Learning FAQ

What is in the Deep Learning Generative Deep Learning syllabus?

Deep Learning Generative Deep Learning is split into 4 chapters: Autoencoders, Generative Adversarial Networks, Diffusion Models and Autoregressive Generation. Together they contain 11 topics.

How many chapters are in Deep Learning Generative Deep Learning?

4 chapters, containing 11 topics. The largest chapter is Diffusion Models, with 4 topics.

Are there flashcards for Deep Learning Generative Deep Learning?

Yes — a 50-card Generative Deep Learning deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.