๐จ Autoencoders & GANs
240 words
1 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# ๐จ Autoencoders & GANs ## 1. ๐ฏ Learning Objectives - Explain autoencoder architecture: encoder โ bottleneck โ decoder - Distinguish VAE (probabilistic) from standard autoencoder - Describe GAN: generator vs discriminator, adversarial training ## 2.

๐จ Autoencoders & GANs
1. ๐ฏ Learning Objectives
- Explain autoencoder architecture: encoder โ bottleneck โ decoder
- Distinguish VAE (probabilistic) from standard autoencoder
- Describe GAN: generator vs discriminator, adversarial training
2. ๐ Core Content
3.1 Autoencoder
Encoder: h=f(Weโx+beโ) โ compresses input to latent code. Decoder: x^=g(Wdโh+bdโ) โ reconstructs input from code. Loss: L=โฃโฃxโx^โฃโฃ2 โ reconstruction error.
3.2 Variational Autoencoder (VAE)
VAE learns a probabilistic latent space: encoder outputs mean ฮผ and variance ฯยฒ. Latent variable z ~ N(ฮผ, ฯยฒ).
Loss: L=reconstructionโฃโฃxโx^โฃโฃ2โโ+regularizationKL(N(ฮผ,ฯ2)โฃโฃN(0,1))โโ
The KL term encourages latent space to be continuous and well-structured.
3.3 GAN (Generative Adversarial Network)
Generator G: Creates fake data from random noise z. Discriminator D: Distinguishes real from fake data.
Minimax game:
Training: Alternate between:
- Train D to distinguish real from fake
- Train G to fool D
4. ๐ Practice Questions
Q1: What is the purpose of the KL divergence term in VAE loss?Answer: It regularizes the latent space to follow a standard normal distribution, ensuring continuity (similar inputs map to nearby latent points) and completeness (every point in latent space produces valid outputs). Join Discord PreviousRNNs & LSTMsNextAutoencoders & GAN Details