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 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 colour image has coordinates, and a general Jacobian of that size would cost about 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:
- autoregressive layers, a second way to get a triangle, and the masks that build them from one network;
- spline layers, a more flexible element-wise map than "scale and shift";
- Glow's linear layers, a learned convolution that mixes channels and ActNorm that normalizes them;
- 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, at , 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.