Intuition The one core idea
A GAN is two networks playing a game: a generator invents fake images, a critic/discriminator judges them, and the generator improves by trying to fool the judge. DCGAN, WGAN and StyleGAN are three upgrades to this game — better building blocks , a better scoring rule , and better control knobs — and to read them you must first know what every symbol in the score, the picture, and the game actually means.
This page assumes you know nothing beyond basic arithmetic and what a picture is. Every symbol used by the parent note is built here, one at a time, each resting on the previous.
Definition Image as a grid of numbers
A digital image is a grid of tiny squares called pixels . Each pixel holds numbers describing its colour. A colour image has 3 channels — Red, Green, Blue — so it is three stacked grids.
Look at the figure: on the left is a tiny 4×4 picture; on the right are its three number-grids peeled apart.
3 × 64 × 64 (a phrase you saw in the parent) means: 3 channels , each a 64-row by 64-column grid. That's 3 × 64 × 64 = 12288 numbers.
Why the topic needs this: a generator's whole job is to output such a grid of numbers . When the parent writes "3 × 64 × 64 RGB image", it is naming the shape of that output.
Definition Normalized pixel range
[ − 1 , 1 ]
Raw pixels run 0 (black) to 255 (bright). We rescale them to the interval from − 1 to + 1 . That interval, written [ − 1 , 1 ] , means "every value v with − 1 ≤ v ≤ 1 ".
[ − 1 , 1 ] ?
Neural networks train best when numbers are small and centred around zero. This is exactly why the parent's generator ends with tanh — a function whose output is always between − 1 and 1 (built in §5).
Definition A vector and the symbol
R n
A vector is just an ordered list of numbers, e.g. [ 0.2 , − 0.5 , 0.8 ] . The symbol R means "all the real numbers" (every decimal). R n means "a list of n real numbers." So z ∈ R 100 reads: "z is a list of 100 real numbers."
The bold z signals this is a vector, not one number . The symbol ∈ means "is an element of / belongs to" .
Intuition Picture: a vector is a point (or arrow) in space
A list of 2 numbers is a point on a flat sheet. A list of 3 numbers is a point in a room. A list of 100 numbers is a point in a space too big to draw — but the idea is identical: one dot, its position fixed by its numbers.
∥ x ∥ — length / distance
The bars ∥ ⋅ ∥ mean the Euclidean norm : the ordinary straight-line length of a vector, by Pythagoras. For x = [ x 1 , x 2 , … , x n ] ,
∥ x ∥ = x 1 2 + x 2 2 + ⋯ + x n 2 .
Then ∥ x 1 − x 2 ∥ is the straight-line distance between two points x 1 and x 2 . Throughout this topic (and the parent's Lipschitz condition), ∥ ⋅ ∥ always means this Euclidean length — not the largest-coordinate (L ∞ ) or sum-of-coordinates (L 1 ) alternatives. For a single number the bars collapse to ordinary absolute value ∣ x ∣ .
Definition The latent vector
z , latent space, and its distribution p ( z )
z is a vector of random numbers fed into the generator — the "seed" of a fake image. The space it lives in (R 100 ) is called latent space . Latent = "hidden": these numbers have no direct meaning yet; the generator learns to turn each seed into an image.
We must say where the random numbers come from . The standard choice is the standard normal : z ∼ N ( 0 , I ) , read "z is drawn from a bell curve centred at 0 with each coordinate independent and spread 1 ." The parent writes this same cloud as p ( z ) , so z ∼ p ( z ) and z ∼ N ( 0 , I ) mean the same thing. (Some papers use Uniform ( − 1 , 1 ) instead; the algebra is identical.)
Why the topic needs it: every GAN starts from z . Different z → different generated image. StyleGAN's whole innovation is about how z enters the network.
A function is a machine: put something in, get something out. We write G ( z ) to mean "feed z into the machine G , read the result." The subscript in G θ names the machine's adjustable settings (defined in §4).
Symbol
Plain meaning
Input → Output
G θ ( z )
Generator
latent vector → fake image
D ( x )
Discriminator (classic GAN)
image → number in [ 0 , 1 ] = "probability real"
f w ( x )
Critic (WGAN)
image → any real number = "realness score"
Intuition Discriminator vs. critic — one picture
The discriminator answers a yes/no question ("real? — 87% sure"), so its output is squeezed into [ 0 , 1 ] . The WGAN critic answers a how much question ("how real, on an open scale?"), so its output can be any real number. That single change is the heart of WGAN.
L — a single scorecard number
A loss L is a function that takes the network's outputs and returns one scalar number measuring "how badly we are doing right now" (bigger = worse). It maps the whole batch of predictions to a single number so we have something concrete to push down . Each player has its own loss: the parent's L D scores the discriminator/critic, L G scores the generator. When we write just L we mean "whichever loss belongs to the network we are currently updating."
θ and w
Inside every network are millions of tunable dials called weights (and biases). θ (theta) is the whole bag of dials for the generator ; w is the bag of dials for the critic. "Training" = slowly turning these dials so its loss L gets smaller.
α and the update rule
When we improve a network we nudge its dials a little. How big a nudge is the learning rate α (alpha). The parent writes
w ← w − α ⋅ ∇ w L
Read it right-to-left: compute a direction ∇ w L , scale it by α , subtract it from the current dials. The arrow ← means "becomes / gets replaced by".
∇
The symbol ∇ (nabla) with a subscript, ∇ w L , means: "for each dial in w , how much does the loss L change if I wiggle that dial?" It is a vector of slopes — a compass pointing in the direction that increases L fastest. We subtract it to go downhill (make L smaller).
Intuition Why a gradient at all?
The loss L is a hilly landscape over millions of dials. We can't check every setting. The gradient is the local downhill arrow — the only affordable way to know which way to step. This is why the parent's whole WGAN complaint — "zero gradient → no learning signal " — is fatal: a flat landscape gives the compass nothing to point at.
Definition Activation function
After each layer of a network, we bend the numbers through a small fixed function so the network can represent curves, not just straight lines. These are activations .
ReLU = max ( 0 , x ) : negatives become 0 , positives pass through. Used in the DCGAN generator .
LeakyReLU : like ReLU but negatives get a small slope instead of a hard 0 , so a gradient still flows for negative inputs. Used in the DCGAN discriminator to avoid "dying" neurons (dials that get stuck because their gradient is always 0 ).
tanh : an S-curve squashing any input into ( − 1 , 1 ) . Used at the generator output so images land exactly in the normalized range from §1.
Recall Why tanh and not ReLU at the output?
Because pixels must span [ − 1 , 1 ] including negatives; ReLU kills all negatives, so it could never produce the dark end of the range. ::: tanh gives the full [ − 1 , 1 ] span.
Definition A distribution
A distribution describes how likely each possible value is. Picture a cloud of dots: dense where values are common, sparse where they're rare. P r = the cloud of real images; P g = the cloud of generated images.
x ∼ P r : the symbol ∼ means "is drawn from ". Read "x is a sample drawn from the real-image cloud."
E x ∼ P r [ f ( x ) ] : E is expectation = the average value of f ( x ) if you keep drawing x from the cloud. Not a sum over a fixed list — an average weighted by how likely each value is.
Intuition Why clouds and not single images?
A generator that only makes one good image is useless. We want the whole cloud P g to match the whole cloud P r . Every GAN loss is really a distance between two clouds . WGAN's genius is choosing a better way to measure that distance.
Definition Manifold — the "thin sheet" that clouds live on
Real images occupy only a razor-thin sheet inside the huge 12288 -number space (most random number-grids look like static, not photos). This thin sheet is a manifold . Two thin sheets in a vast space usually don't overlap — which is precisely why the parent says JS divergence breaks early in training.
Now that G , D , E and ∼ are built, we can write the actual game the parent starts from.
Intuition Reading the two lines
First line: "make D ( real ) big (so log D big) and make D ( fake ) small (so log ( 1 − D ) big)." Second line: the generator pushes D ( G ( z )) up toward 1 . They pull in opposite directions — that is the adversarial game. The parent's key claim is that when the two clouds don't overlap, D becomes perfect, D ( G ( z )) ≈ 0 , and L G 's gradient vanishes — motivating WGAN.
Definition Divergence, infimum
inf , supremum sup
A divergence is a number saying "how different are these two clouds." Two operators appear:
inf (infimum ) = the greatest lower bound ≈ "the smallest achievable value."
sup (supremum ) = the least upper bound ≈ "the largest achievable value."
They are careful versions of "minimum" and "maximum" that still work when the exact best value is only approached, never reached.
inf and sup actually get used
The inf in W says: "among all transport plans, take the cheapest one" — the smallest possible shovelling cost is the distance. The sup in the dual says: "among all slope-limited critics, take the one that most separates the two average scores." So inf /sup are not decorations — they select the single best plan / best critic that defines the number. The critic network f w is our attempt to reach that sup .
Definition The Lipschitz norm
∥ f ∥ L and ∥ f ∥ L ≤ 1
∥ f ∥ L is the Lipschitz constant of f : the steepest slope f ever has , measured as
∥ f ∥ L = sup x 1 = x 2 ∥ x 1 − x 2 ∥ ∥ f ( x 1 ) − f ( x 2 ) ∥ .
It divides "how much the output moved" by "how much the input moved" and takes the biggest such ratio anywhere. Saying ∥ f ∥ L ≤ 1 (call f 1-Lipschitz ) means that ratio never exceeds 1 , i.e. ∥ f ( x 1 ) − f ( x 2 ) ∥ ≤ ∥ x 1 − x 2 ∥ for all inputs — pictured as a graph never steeper than 45° . WGAN forces this so the critic's score can't blow up to infinity, keeping the sup meaningful.
Normalized range minus1 to plus1
Functions G and D and critic f
Gradient and learning rate
Divergence JS vs Wasserstein
Every arrow points toward the parent topic the main note : you need each box before that note's symbols make sense.
Cover the right side and answer aloud.
What does 3 × 64 × 64 describe? 3 colour channels, each a 64×64 grid of pixels — one RGB image.
What does z ∈ R 100 mean in words? z is a list of 100 real numbers (the latent seed vector).
Where do the numbers in z come from? They are drawn from a fixed prior, usually z ∼ N ( 0 , I ) , which the parent also writes z ∼ p ( z ) .
What is the symbol ∈ ? "is an element of / belongs to."
What does the norm ∥ x 1 − x 2 ∥ compute, and which norm is it? The Euclidean (straight-line) distance between points
x 1 and
x 2 :
∑ i ( x 1 , i − x 2 , i ) 2 .
Difference between D ( x ) and f w ( x ) ? D outputs a probability in [ 0 , 1 ] (yes/no realness); the WGAN critic f w outputs any real number (how-much realness).
What is the loss L ? A function mapping the network's outputs to one scalar "how-bad" number that training pushes down.
What do θ and w stand for? The bags of tunable weights for the generator and the critic respectively.
What does ∇ w L tell you? For each weight in w , how much the loss L changes if you wiggle it — the uphill direction; we subtract it to go downhill.
Why subtract α ⋅ ∇ w L and not add? To move down the loss landscape; α (learning rate) sets step size.
Write the vanilla discriminator objective. L D = E x ∼ P r [ log D ( x )] + E z ∼ p ( z ) [ log ( 1 − D ( G ( z )))] , maximized.
What does tanh guarantee about its output? It always lies strictly between − 1 and 1 , matching normalized pixels.
Why LeakyReLU in the discriminator? It keeps a small gradient for negative inputs, preventing "dead" neurons.
What does x ∼ P r mean? x is a sample drawn from the real-image distribution.
What is E x ∼ P r [ f ( x )] ? The average of f ( x ) over images drawn from the real cloud.
Why do real images live on a "manifold"? They fill only a thin sheet of the huge pixel space; random grids are static, not photos — so real/fake sheets rarely overlap.
Why does JS divergence give no gradient on disjoint clouds? It saturates at the constant log 2 ; a constant has zero slope, so the compass points nowhere.
How is W defined, and what does its inf select? W = inf γ E ( x , y ) ∼ γ ∥ x − y ∥ ; the inf picks the cheapest transport plan (least shovelling cost).
What is ∥ f ∥ L and what does ∥ f ∥ L ≤ 1 mean? The largest slope ratio ∥ f ( x 1 ) − f ( x 2 ) ∥/∥ x 1 − x 2 ∥ ; ≤ 1 means the graph is never steeper than 45°.