Generalization of the Change of Variables Formula with Applications to Residual Flows

Niklas Koenen, Marvin N. Wright, Peter Maaß, Jens Behrmann

Abstract

Normalizing flows are a class of generative models that transform a simple probability distribution into a complex one using a sequence of invertible mappings. Traditionally, the Change of Variables Formula (CVF) used to calculate probability densities requires these transformations to be $C^1$ diffeomorphisms. This requirement is at odds with the widespread use of non-smooth activation functions, such as ReLU, in modern deep learning. This paper introduces the concept of $\mathcal{L}$-diffeomorphisms, a generalized class of transformations that are differentiable almost everywhere. By proving that the CVF remains valid for $\mathcal{L}$-diffeomorphisms, the authors provide a rigorous theoretical foundation for using non-smooth activations in various residual flow architectures.

Introduction

Normalizing flows have emerged as powerful tools for density estimation and generative modeling. Their utility hinges on the Change of Variables Formula (CVF), which relates the density of a transformed variable to the density of the original variable via the Jacobian determinant of the transformation. Standard measure theory dictates that for the CVF to hold, the transformation must be a diffeomorphism—a bijective mapping where both the function and its inverse are continuously differentiable ($C^1$).

In practice, however, deep learning architectures frequently employ non-smooth components like ReLU or Leaky ReLU, which possess "kinks" where the derivative is undefined. While these functions are used empirically in flows, their theoretical legitimacy has been questionable. This paper addresses this gap by formalizing the use of non-smooth functions through measure-theoretic generalizations presented at an ICML 2021 workshop.

Methods

The authors relax the strict $C^1$ requirement by utilizing the concept of Lebesgue measure zero ($\lambda^n$-null sets). They define $\mathcal{L}$-diffeomorphisms as mappings that satisfy diffeomorphism requirements almost everywhere, except on a null set.

The core contribution is Theorem 4, which demonstrates that the CVF remains valid for these generalized mappings. This implies that the volume correction term (the Jacobian determinant) can still be used for integration even if it is undefined at a negligible set of points. Furthermore, the authors show that $\mathcal{L}$-diffeomorphisms are closed under composition, allowing for the deep stacking of layers common in normalizing flows.

The theory is applied to three specific flow types:

  1. Planar Flows: Transformations expanding or contracting hyperplanes.
  2. Radial Flows: Transformations centered around a point.
  3. Contractive Residual Flows (i-ResNets): General perturbations of the identity mapping.

Results and Key Insights

The primary result is the mathematical "legitimization" of non-smooth flows. The authors provide formal proof (Theorem 10) that contractive residual flows remain $\mathcal{L}$-diffeomorphisms even when using non-smooth perturbations, provided the non-smoothness occurs on a closed null set.

For planar flows, the authors derive specific parameter constraints required to maintain bijectivity and the $\mathcal{L}$-diffeomorphism property for various common activations.

Table 1: Conditions for various non-linearities to ensure bijectivity in planar flows.

These conditions ensure that the transformation remains a "proper flow" despite the presence of non-differentiable points. For instance, a ReLU-based planar flow is valid if the parameters satisfy $w^T u > -1$.

Discussion and Limitations

While this work provides a solid theoretical footing, several practical considerations remain. Numerical instability may arise if gradients are evaluated exactly at a "kink" (a non-differentiable point). Furthermore, while the paper proves these flows are mathematically valid, it does not empirically demonstrate that non-smooth flows outperform smooth alternatives. Future research is needed to explore the performance gains of non-smooth activations in large-scale generative tasks and to extend this framework to more complex architectures like autoregressive or Sylvester flows.

Conclusion

By bridging the gap between rigorous measure theory and practical deep learning, this paper provides the necessary theoretical framework for the next generation of residual flows. Researchers can now utilize non-smooth activations with the mathematical certainty that their density models are theoretically sound.

Summary updated

BibTeX
@inproceedings{koenen2021generalization,
  author = {Niklas Koenen and Marvin N. Wright and Peter Maaß and Jens Behrmann},
  title = {{Generalization of the Change of Variables Formula with Applications to Residual Flows}},
  booktitle = {INNF @ ICML},
  year = {2021},
  url = {https://openreview.net/forum?id=msCiI5dejr},
}
Figure