CDFlow: Building Invertible Layers with Circulant and Diagonal Matrices
Xuchen Feng, Siyu Liao
TL;DR
CDFlow presents a circulant-diagonal factorization for invertible linear layers in normalizing flows, reducing parameter and computation costs while preserving expressiveness. By representing weight matrices as alternating diagonal and circulant factors and leveraging FFTs, the approach achieves $O(mn)$ storage, $O(mn)$ log-determinant evaluation, and $O(mn\log n)$ inversion, enabling efficient training and sampling. Integrated into a multi-scale flow with ActNorm and coupling, CDFlow delivers strong density estimation on standard image datasets and excels on data with periodic structure, such as galaxy images, while demonstrating favorable runtime characteristics. The work provides a practical, scalable path for high-dimensional flow-based modeling with structured matrices and FFT acceleration.
Abstract
Normalizing flows are deep generative models that enable efficient likelihood estimation and sampling through invertible transformations. A key challenge is to design linear layers that enhance expressiveness while maintaining efficient computation of the Jacobian determinant and inverse. We introduce a novel invertible linear layer based on the product of circulant and diagonal matrices. This decomposition reduces parameter complexity from $\mathcal{O}(n^2)$ to $\mathcal{O}(mn)$ using $m$ diagonal matrices and $m-1$ circulant matrices while still approximating general linear transformations. By leveraging the Fast Fourier Transform, our approach reduces the time complexity of matrix inversion from $\mathcal{O}(n^3)$ to $\mathcal{O}(mn\log n)$ and that of computing the log-determinant from $\mathcal{O}(n^3)$ to $\mathcal{O}(mn)$, where $n$ is the input dimension. We build upon this layer to develop Circulant-Diagonal Flow (CDFlow), which achieves strong density estimation on natural image datasets and effectively models data with inherent periodic structure. Furthermore, CDFlow significantly accelerates key operations in normalizing flows, providing practical benefits for scalable generative modeling.
