Explain GAN architecture, generator and discriminator roles, and objective function
Tests adversarial training as a minimax game. Strong answers: generator maps noise z to fakes; discriminator classifies real versus fake; both optimize V(D,G)=E[log D(x)]+E[log(1-D(G(z)))].
WHAT THIS TESTS: This question probes whether you understand generative modeling through adversarial dynamics rather than memorizing a diagram. Interviewers want to see that you treat the generator and discriminator as coupled players in a game, not as isolated networks with private loss functions. At the senior level, clarity on why alternating optimization is necessary and how gradients flow through both networks separates candidates who have trained GANs from those who have only read about them.
A GOOD ANSWER COVERS: A strong response hits four points in order. First, the generator G is a neural network that takes a latent vector z sampled from a simple prior like a standard Gaussian and maps it through upsampling or transposed convolution layers to produce synthetic data G of z that aims to match the true data distribution. Second, the discriminator D is a binary classifier typically built from convolutional or dense layers that outputs a scalar probability D of x representing the chance that input x came from the real dataset rather than from G. Third, training proceeds alternately rather than simultaneously in most implementations: fix G and train D for k steps to better distinguish real from fake, then fix D and train G for one step to maximize the probability that D misclassifies G of z as real. Fourth, the joint objective is the minimax value function V of D and G equals the expectation over real data x of log D of x plus the expectation over noise z of log of one minus D of G of z, where D tries to maximize V and G tries to minimize it.
COMMON WRONG ANSWERS: Red flags include describing the generator and discriminator as optimizing two independent losses without referencing the shared value function, claiming both networks update at exactly the same time in a single forward or backward pass, or stating that G minimizes binary cross entropy directly instead of maximizing log D of G of z. Another frequent mistake is omitting the latent space entirely or suggesting that G learns a deterministic copy of the training set rather than the underlying distribution.
LIKELY FOLLOW-UPS: Expect the interviewer to ask why the original GAN paper uses log of one minus D of G of z for the generator rather than the more practical heuristic of maximizing log D of G of z, or how mode collapse manifests when G discovers a single sample that always fools D. They may also ask about spectral normalization, Wasserstein variants, or whether the discriminator can be reused as a feature extractor.
ONE CONCRETE EXAMPLE: When training a GAN on the MNIST dataset, the generator might accept a hundred-dimensional noise vector and output a twenty-eight by twenty-eight grayscale image. The discriminator receives either a real MNIST digit or the generator output and predicts a single probability. In practice, the discriminator is updated for five minibatches while the generator is frozen, then the generator is updated for one minibatch while the discriminator is frozen, with the generator target set to one so that binary cross entropy drives D of G of z toward one.
Read the original → en.wikipedia.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.