Normalizing Flows
Normalizing Flows is a technique used to transform complex data distributions into much simple latent distributions. They allow for an exact log-likelihood evaluation and posterior inference (retrieving unique latent \(z\) for each input \(x\)).
Change of Variables¶
We describe the flow as an transformation from an latent space \(p_{\theta}(z)\) into the data distribution \(p_{\theta}(x)\) using an invertible function \(f(z)=x\) and \(f^{-1}(x)=z\). Then, we can transform the latent distribution into the data distribution using the change of variables formula:
To make this model very expressive without an extremely complicated transformation function, we repeatedly apply functions \(x=f_{\theta}(z)=f_{k}\circ\cdots\circ f_{2} \circ f_{1}(z)\) where each \(f_{i}\) has a simple to compute [[Jacobian Matrix]] determinant. For the distributions of \(x\) and \(z\), we can repeatedly apply the change of variables formula:
and by moving into log-space, this converts to a sum:
Triangular Jacobian¶
By fixing the Jacobian to be a triangular matrix using coupling layers (see @dinhNICENonlinearIndependent2014), the determinant is equal to the product of diagonal elements in the matrix.