Quiz: normalising flows

Short questions on the change of variables, coupling layers and the uses and limits of flows. Try each on paper first, then open the answer.


Q1. Noise z \sim \mathcal N(0, 1) is mapped to x = 3z. At x = 0, is the density of x higher or lower than that of z at z = 0, and by what factor?

The map stretches by 3.

Lower, by a factor 3: p_X(0) = p_Z(0)/3 = 0.399/3 = 0.133. The same probability is spread over three times the length.


Q2. Why can a coupling layer be inverted even though its small network s, t (a ReLU network, say) cannot?

What is the input of s and t, and is it known during the inverse?

s and t only see the kept half x_1, which passes through unchanged: y_1 = x_1. In the inverse, y_1 is known, so s(y_1) and t(y_1) are simply recomputed (a forward pass), and x_2 = (y_2 - t)\,e^{-s}. The network is never inverted.


Q3. A coupling layer has s = (0.5, -0.2, 0.1) for the three numbers it changes. What is its log-determinant, and does it expand or shrink volume?

\log|\det J| = \sum s.

0.5 - 0.2 + 0.1 = 0.4; e^{0.4} = 1.49 > 1: it expands volume by about half.


Q4. What does a flow give that a VAE and a GAN do not?

Think of \log p(x).

The exact log-likelihood \log p(x) of any point (the VAE gives a lower bound, the GAN nothing), together with sampling in one pass and an exact inverse (an encoding z = f(x) that loses nothing).


Q5. A flow trained on images of healthy cells assigns a very high likelihood to a nearly empty, smooth image. Is that image a typical healthy cell?

What makes an image “easy” for a density model?

No. Smooth, low-detail images get high likelihood because they have little to code, not because they look like the training data. Likelihood is not typicality: an anomaly score from a flow must be tested on known anomalies.


Q6. Why does a flow trained on two separated clusters leave a thin trail of probability between them?

Can a smooth invertible map turn one connected blob into two pieces?

A continuous invertible map keeps connected sets connected. The Gaussian is one blob, so its image stays connected: the flow can make the bridge between the clusters very thin, but not remove it.


Q7. (math) Two layers with Jacobians J_1 and J_2 are applied one after the other. What is the log-determinant of the whole map?

Chain rule, then \det(AB) = \det A\det B.

The Jacobian is J_2J_1 (each evaluated at its own input), so \log|\det| = \log|\det J_1| + \log|\det J_2|: log-determinants add over layers.