Skip to content
ML to LLMs
Learning path

Module 13

Deep-learning architectures

CNNs for grids, RNNs and LSTMs for sequences, autoencoders, GANs, latent diffusion, and flow matching for generation, and transfer learning.

  1. 1. Convolutional networksSlide a kernel over an image to compute a feature map by hand, track output sizes with stride and padding, pool, and see why CNNs suit images.35 min
  2. 2. Recurrent networks, LSTMs, and GRUsUnroll an RNN through time by hand, explain why long dependencies are hard, see how LSTM and GRU gates help, and understand why transformers replaced them for language.35 min
  3. 3. Autoencoders, diffusion, and transfer learningLearn compressed representations with autoencoders, understand how diffusion models generate by reversing noise, and adapt pretrained models to new tasks with transfer learning.35 min
  4. 4. GANs, generator versus discriminatorTrain a generator and a discriminator against each other, derive the optimal discriminator and the non-saturating loss, and diagnose mode collapse and vanishing gradients.40 min
  5. 5. Latent diffusion and Stable DiffusionExplain why Stable Diffusion runs diffusion in an autoencoder's latent space, how text enters through cross-attention, and how classifier-free guidance trades diversity for prompt adherence; build a toy latent diffusion model with guidance.40 min
  6. 6. Flow matching and rectified flowsTrain a generator by regressing a velocity field onto straight lines between noise and data, sample by integrating an ODE, see why one Euler step fails and how reflow straightens paths, and relate it all to diffusion.40 min

Architectures encode assumptions (inductive biases) about the data. Convolutions assume local patterns that repeat across an image. Recurrence assumes information flows in order. Autoencoders assume data lies near a lower-dimensional space. Choosing an architecture is choosing an assumption.

ArchitectureInductive biasCommon uses
MLPgeneric feature interactionstabular data, prediction heads
CNNlocal patterns, translation structureimages, audio spectrograms
RNN / LSTM / GRUsequential hidden statetime series, streaming
Transformercontent-based global attentionlanguage, vision, multimodal
Autoencodercompress then reconstructrepresentation learning, denoising
GANa learned critic judges realismnarrow-domain images, adversarial losses
Diffusion / flow matchingiterative denoising along a path from noiseimage, video, and audio generation
#LessonYou will be able to
1Convolutional networkscompute a convolution and pooling by hand and track feature-map sizes
2Recurrent networks, LSTMs, and GRUsunroll an RNN, explain gates, and say why transformers replaced them
3Autoencoders, diffusion, and transfer learningexplain bottlenecks, latent spaces, denoising diffusion, and fine-tuning a pretrained model
4GANs, generator versus discriminatortrain a GAN with the non-saturating loss and diagnose mode collapse
5Latent diffusion and Stable Diffusionexplain latent compression, cross-attention conditioning, and classifier-free guidance
6Flow matching and rectified flowstrain a velocity field on straight noise-to-data paths and straighten it with reflow
Next moduleModule 14: Transformers