Skip to content
BIASED

Flow architectures

Block 1 of 8~2 min

What a flow on images needs

The topic The change of variables left us with one working layer. An affine coupling layer copies half of the coordinates and scales and shifts the other half with networks of the copied half. Its Jacobian is triangular, so log⁡∣det⁡Jf∣\log\lvert\det J_f\rvert is a plain sum of the scales. Stacked with swaps in between, such layers already make a flow.

A real image needs more than that. A 64×6464 \times 64 colour image has D=64⋅64⋅3=12288D = 64 \cdot 64 \cdot 3 = 12288 coordinates, and a general Jacobian of that size would cost about 23D3≈1.2⋅1012\tfrac23 D^3 \approx 1.2 \cdot 10^{12} operations per layer and per example. So every layer of this topic keeps the two rules of the previous one: an inverse we can compute and a cheap log-determinant. Within those rules we meet four more parts:

  1. autoregressive layers, a second way to get a triangle, and the masks that build them from one network;
  2. spline layers, a more flexible element-wise map than "scale and shift";
  3. Glow's linear layers, a learned 1×11 \times 1 convolution that mixes channels and ActNorm that normalizes them;
  4. the image skeleton: masks on the pixel grid, the squeeze, and multiple scales.

One fact serves all of them. The inverse of a layer has the inverse Jacobian, Jf−1(z)=Jf(x)−1J_{f^{-1}}(z) = J_f(x)^{-1} at z=f(x)z = f(x), and the determinant of an inverse matrix is the reciprocal. So a determinant that is cheap in one direction is cheap in the other, and the log-determinant only changes sign.

Answers are saved on the server and tied to this browser until you sign in.