Equivariant Manifold Flows
Abstract
Tractably modelling distributions over manifolds has long been an important goal in the natural sciences. Recent work has focused on developing general machine learning models to learn such distributions. However, for many applications these distributions must respect manifold symmetries—a trait which most previous models disregard. In this paper, we lay the theoretical foundations for learning symmetry-invariant distributions on arbitrary manifolds via equivariant manifold flows. We demonstrate the utility of our approach by learning quantum field theory-motivated invariant densities and by correcting meteor impact dataset bias.
1 Introduction

Learning probabilistic models for data has long been the focus of many problems in machine learning and statistics. Though much effort has gone into learning models over Euclidean space [20, 6, 21], less attention has been allocated to learning models over non-Euclidean spaces, despite the fact that many problems require a manifold structure. Density learning over non-Euclidean spaces has applications ranging from quantum field theory in physics [44] to motion estimation in robotics [16] to protein-structure prediction in computational biology [22].
Continuous normalizing flows (CNFs) [6, 21] are powerful generative models for learning structure in complex data due to their tractability and theoretical guarantees. Recent work [29, 30] has extended the framework of continuous normalizing flows to the setting of density learning on Riemannian manifolds. However, for many applications in the natural sciences, this construction is insufficient as it cannot properly model necessary symmetries. For example, such symmetry requirements arise when sampling coupled particle systems in physical chemistry [26] or sampling for use in 111 denotes the special unitary group . lattice gauge theories in theoretical physics [3].
More precisely, these symmetries are invariances with respect to action by an isometry subgroup of the underlying manifold. For example, consider the task of learning a density on the sphere that is invariant to rotation around an axis; this is an example of learning an isometry subgroup invariant222This specific isometry subgroup is known as the isotropy group at a point of the sphere intersecting the axis. density. For a less trivial example, note that when learning a flow-based sampler for in the context of lattice QFT [3], the learned density must be invariant to conjugation by (see Figure 1 for a density on that exhibits the requisite symmetry).
One might naturally attempt to work with the quotient of the manifold by the relevant isometry subgroup in order to model the invariance. First, note that this structure is not always a manifold, and additional restrictions are needed on the action to ensure the quotient will have a manifold structure333In particular, the isometry subgroup action needs to be smooth, free, and proper to ensure the quotient will be a manifold by the Quotient Manifold Theorem [28].. Assuming the quotient is in fact a manifold, one then asks whether an invariant density may be modelled by learning over this quotient with a general manifold density learning method such as NMODE [29]? Though this seems plausible, it is a problematic approach for several reasons:
-
1.
First, it is often difficult to realize necessary constructs (charts, exponential maps, tangent spaces) on the quotient manifold (e.g. this is the case for , a quotient of [28]).
-
2.
Second, even if the above constructs can be realized, the quotient manifold often has a boundary, which precludes the use of a manifold CNF. To illustrate this point, consider the simple case of the sphere invariant to rotation about an axis; the quotient manifold is a closed interval, and a CNF would “flow out" on the boundary.
-
3.
Third, even if the quotient is a manifold without boundary for which we have a clear characterization, it may have a discrete structure that induces artifacts in the learned distribution. This is the case for Boyda et al. [3]: the flow construction over the quotient induces abnormalities in the density.
Motivated by the above drawbacks, we design a manifold continuous normalizing flow on the original manifold that maintains the requisite symmetry invariance. Since vanilla manifold CNFs do not maintain said symmetries, we instead construct equivariant manifold flows and show they induce the desired invariance. To construct these flows, we present the first general way of designing equivariant vector fields on manifolds. A summary of our paper’s contributions is as follows:
-
•
We present a general framework and the requisite theory for learning equivariant manifold flows: in our setup, the flows can be learned over arbitrary Riemannian manifolds while explicitly incorporating symmetries inherent to the problem. Moreover, we prove that the equivariant flows we construct can universally approximate distributions on closed manifolds.
-
•
We demonstrate the efficacy of our approach by learning gauge invariant densities over in the context of quantum field theory. In particular, when applied to the densities in Boyda et al. [3], we adhere more naturally to the target geometry and avoid the unnatural artifacts of the quotient construction.
-
•
We highlight the benefit of incorporating symmetries into manifold flow models by comparing directly against previous general manifold density learning approaches. We show that when a general manifold learning model is not aware of symmetries inherent to the problem, the learned density is of considerably worse quality and violates said symmetries. Prior to our work, there did not exist literature that demonstrated the benefits of incorporating isometry group symmetries for learning flows on manifolds, yet we achieve these benefits, and do so through a novel equivariant vector field construction.
2 Related Work
Our work builds directly on pre-existing manifold normalizing flow models and enables them to leverage inherent symmetries through equivariance. In this section we cover important developments from the relevant fields: manifold normalizing flows and equivariant machine learning.
Normalizing Flows on Manifolds
Normalizing flows on Euclidean space have long been touted as powerful generative models [10, 6, 21]. Similar to GANs [20] and VAEs [24], normalizing flows learn to map samples from a tractable prior density to a target density. However, unlike the aforementioned models, normalizing flows account for changes in volume, enabling exact evaluation of the output probability density. In a rather concrete sense, this makes them theoretically principled. As such, they are ideal candidates for generalization beyond the Euclidean setting, where a careful, theoretically principled modelling approach is necessary.
Motivated by recent developments in geometric deep learning [4], many methods have extended normalizing flows to Riemannian manifolds. Rezende et al. [38] introduced constructions specific to tori and spheres, while Bose et al. [2] introduced constructions for hyperbolic space. Following this work, Lou et al. [29], Mathieu and Nickel [30], Falorsi and Forré [15] concurrently introduced a general construction by extending Neural ODEs [6] to the setting of Riemannian manifolds. Our work takes inspiration from the methods of Lou et al. [29], Mathieu and Nickel [30] and generalizes them further to enable learning that takes into account symmetries of the target density.
Equivariant Machine Learning
Motivated by the observation that many classic neural network architectures incorporate symmetry as an inductive bias, recent work has leveraged symmetries inherent in data through the concept of equivariance [7, 9, 8, 27, 18, 37]. Köhler et al. [26], in particular, used equivariant normalizing flows to enable learning symmetric densities over Euclidean space. The authors note their approach is better suited to density learning in some physical chemistry settings (when compared to general purpose normalizing flows), since they take into account the symmetries of the problem.
Symmetries also appear naturally in the context of learning densities over manifolds. While in many cases symmetry can be a good inductive bias for learning444For example, asteroid impacts on the sphere can be modelled as being approximately invariant to rotation about the Earth’s axis., for certain test tasks it is a strict requirement. For example, Boyda et al. [3] introduced equivariant flows on for use in lattice gauge theories, where the modelled distribution must be conjugation invariant. However, beyond conjugation invariant learning on [3], not much other work has been done for learning invariant distributions over manifolds. Our work bridges this gap by introducing the first general equivariant manifold normalizing flow model for arbitrary manifolds and symmetries.
3 Background
In this section, we provide a terse overview of necessary concepts for understanding our paper. In particular, we address fundamental notions from Riemannian geometry as well as the basic set-up of normalizing flows on manifolds. For a more detailed introduction to Riemannian geometry, we refer the reader to textbooks such as Lee [28] and Kobyzev et al. [25].
3.1 Riemannian Geometry
A Riemannian manifold is an -dimensional manifold with a smooth collection of inner products for every tangent space . The Riemannian metric induces a distance on the manifold.
A diffeomorphism is a differentiable bijection with differentiable inverse. A diffeomorphism is called an isometry if for all tangent vectors where is the differential of . Note that isometries preserve the manifold distance function. The collection of all isometries forms a group , which we call the isometry group of the manifold .
Riemannian metrics also allow for a natural analogue of gradients on . For a function , we define the Riemannian gradient to be the vector on such that for .
3.2 Normalizing Flows on Manifolds
Manifold Normalizing Flow
Let be a Riemannian manifold. A normalizing flow on is a diffeomorphism (parametrized by ) that transforms a prior density to model density . The model distribution can be computed via the Riemannian change of variables555Here, is the determinant function with volume induced by the Riemannian metric .:
Manifold Continuous Normalizing Flow
A manifold continuous normalizing flow with base point is a function that satisfies the manifold ODE
We define , to map any base point to the value of the CNF starting at , evaluated at time . This function is known as the (vector field) flow of .
3.3 Equivariance and Invariance
Let be an isometry subgroup of . We notate the action of an element on by the map .
Equivariant and Invariant Functions We say that a function is equivariant if, for all isometries and , we have . We say a function is invariant if .
Equivariant Vector Fields Let , be a time-dependent vector field on manifold , with base point . is a -equivariant vector field if , .
Equivariant Flows A flow is -equivariant if it commutes with actions from , i.e. we have .
Invariance of Density A density on a manifold is -invariant if, for all and , , where is the action of on .
4 Invariant Densities from Equivariant Flows
Our goal in this section is to describe a tractable way to learn a density over a manifold that obeys a symmetry given by an isometry subgroup . Since this cannot be done directly and it is not clear how a manifold continuous normalizing flow can be altered to preserve symmetry, we will derive the following implications to yield a tractable solution:
-
1.
-invariant potential -equivariant vector field (Theorem 1). We show that given a -invariant potential function , the vector field is -equivariant.
-
2.
-equivariant vector field -equivariant flow (Theorem 2). We show that a -equivariant vector field on uniquely induces a -equivariant flow.
-
3.
-equivariant flow -invariant density (Theorem 3). We show that given a -invariant prior and a -equivariant flow , the flow density is -invariant.
These are constructed in the same spirit as the theorems in Köhler et al. [26] (which also appeared in Papamakarios et al. [34]), although we note that our results are significantly more general. In addition to extending the domain to Riemannian manifolds, we consider arbitrary symmetry groups while Köhler et al. [26] only considers the linear Lie group . As a result, our proof techniques are based on heavy geometric machinery instead of straightforward linear algebra techniques.
If we have a prior distribution on the manifold that obeys the requisite invariance, then the above implications show that we can use a -invariant potential to produce a flow that, in tandem with the CNF framework, learns an output density with the desired invariance. We claim that constructing a -invariant potential function on a manifold is far simpler than directly parameterizing a -invariant density or a -equivariant flow. We shall give explicit examples of -invariant potential constructions in Section 5.2 that induce a desired density invariance.
Moreover, we show in Theorem 4 that considering equivariant flows generated from invariant potential functions suffices to learn any smooth distribution over a closed manifold, as measured by Kullback-Leibler divergence.
We defer the proofs of all theorems to the appendix.
4.1 Equivariant Gradient of Potential Function
We start by showing how to construct -equivariant vector fields from -invariant potential functions.
To design an equivariant vector field , it is sufficient to set the vector field dynamics of as the gradient of some -invariant potential function . This is formalized in the following theorem.
Theorem 1.
Let be a Riemannian manifold and be its group of isometries (or an isometry subgroup). If is a smooth -invariant function, then the following diagram commutes for any :
or . Hence is a -equivariant vector field. This condition is also tight in the sense that it only occurs if is the isometry subgroup.
Hence, as long as one can construct a -invariant potential function, one can obtain the desired equivariant vector field. By this construction, a parameterization of -invariant potential functions yields a parameterization of (some) -equivariant vector fields.
4.2 Constructing Equivariant Manifold Flows from Equivariant Vector Fields
To construct equivariant manifold flows, we will use tools from the theory of manifold ODEs. In particular, there exists a natural correspondence between equivariant flows and equivariant vector fields. We formalize this in the following theorem:
Theorem 2.
Let be a Riemannian manifold, and be its isometry group (or one of its subgroups). Let be any time-dependent vector field on , and be the flow of . Then is a -equivariant vector field if and only if is a -equivariant vector field flow.
Hence we can obtain an equivariant flow from an equivariant vector field, and vice versa.
4.3 Invariant Manifold Densities from Equivariant Flows
We now show that -equivariant flows induce -invariant densities. Note that we require the group to be an isometry subgroup in order to control the density of , and the following theorem does not hold for general diffeomorphism subgroups.
Theorem 3.
Let be a Riemannian manifold, and be its isometry group (or one of its subgroups). If is a -invariant density on , and is a -equivariant diffeomorphism, then is also -invariant.
In the context of manifold normalizing flows, Theorem 3 implies that if the prior density on is -invariant and the flow is -equivariant, the resulting output density will be -invariant. In the context of the overall set-up, this reduces the problem of constructing a -invariant density to the problem of constructing a -invariant potential function.
4.4 Sufficiency of Flows Generated via Invariant Potentials
It is unclear whether equivariant flows induced by invariant potentials can learn arbitrary invariant distributions over manifolds. In particular, it is reasonable to have some concerns about limited expressivity, since it is unclear whether any equivariant flow can be generated in this way. We alleviate these concerns for our use cases by proving that equivariant flows obtained from invariant potential functions suffice to learn any smooth invariant distribution over a closed manifold, as measured by Kullback-Leibler (KL) divergence.
Theorem 4.
Let be a closed Riemannian manifold. Let be a smooth, non-vanishing distribution over , which will act as our target distribution. Let be a distribution over said manifold parameterized by a real time variable , with acting as the initial distribution. Let denote the Kullback–Leibler divergence between distributions and . If we choose a such that
and if evolves with as the distribution of a flow according to , it follows that
implying convergence of to in . Moreover, the exact diffeomorphism that takes us from is as follows. Given some initial point , let be the solution to the initial value problem given by:
The desired diffeomorphism maps to .
Hence if the target distribution is , the current distribution is , and as defined above is the potential from which the flow controlling the evolution of is obtained, then converges to in . This means that considering flows generated by invariant potential functions is sufficient to learn any smooth invariant target distribution on a closed manifold (as measured by KL divergence).
5 Learning Invariant Densities with Equivariant Flows
In this section, we discuss implementation details of the methodology given in Section 4. In particular, we describe the equivariant manifold flow model, provide two examples of invariant potential constructions on different manifolds, and discuss how training is performed depending on the target task.
5.1 Equivariant Manifold Flow Model
For our equivariant flow model, we first construct a -invariant potential function (we show how to construct these potentials in Section 5.2). The equivariant flow model works by using automatic differentiation [35] on to obtain , using this for the vector field, and integrating in a step-wise fashion over the manifold. Specifically, forward integration and change-in-density (divergence) computations utilize the Riemannian Continuous Normalizing Flows [30] framework. This flow model is used in tandem with a specific training procedure (described in Section 5.3) to obtain a -invariant model density that approximates some target.
5.2 Constructing -invariant Potential Functions
In this subsection, we present two constructions of invariant potentials on manifolds. Note that a symmetry of a manifold (i.e. action by an isometry subgroup) will leave part of the manifold free. The core idea of our invariant potential construction is to parameterize a neural network on the free portion of the manifold. While the two constructions we give below are certainly not exhaustive, they illustrate the versatility of our method, which is applicable to general manifolds and symmetries.
5.2.1 Isotropy Invariance on
Consider the sphere , which is the Riemannian manifold with the induced pullback metric. The isotropy group for a point is defined as the subgroup of the isometry group which fixes , i.e. the set of rotations around an axis that passes through . In practice, we let , so the isotropy group is the group of rotations on the -plane. An isotropy invariant density would be invariant to such rotations, and hence would look like a horizontally-striped density on the sphere (see Figure 4(a)).
Invariant Potential Parameterization
We design an invariant potential by applying a neural network to the free parameter. In the case of our specific isotropy group listed above, the free parameter is the -coordinate. The invariant potential is simply a -input neural network with the spatial input being the -coordinate and the time input being the time during integration. As a result of this design, we see that the only variance in the learned distribution that uses this potential will be along the -axis, as desired.
Prior Distributions
For proper learning with a normalizing flow, we need a prior distribution on the sphere that respects the isotropy invariance. There are many isotropy invariant potentials on the sphere. Natural choices include the uniform density (which is invariant to all rotations) and the wrapped distribution with the center at [40, 33]. For our experiments, we use the uniform density.
5.2.2 Conjugation Invariance on
For many applications in physics (specifically gauge theory and lattice quantum field theory), one works with the Lie Group — the group of unitary matrices with determinant . In particular, when modelling probability distributions on for lattice QFT, the desired distribution must be invariant under conjugation by [3]. Conjugation is an isometry on (see Appendix A.5), so we can model probability distributions invariant under this action with our developed theory.
Invariant Potential Parameterization
We want to construct a conjugation invariant potential function . Note that matrix conjugation preserves eigenvalues. Thus, for a function to be invariant to matrix conjugation, it has to act on the eigenvalues of as a multi-set.
We can parameterize such potential functions by the DeepSet network from [45]. DeepSet is a permutation invariant neural network that acts on the eigenvalues, so the mapping of is for some set function . We append the integration time to the input of the standard neural network layers in the DeepSet network.
As a result of this design, we see that the only variance in the learned distribution will be amongst non-similar matrices, while all similar matrices will be assigned the same density value.
Prior Distributions
For the prior distribution of the flow, we need a distribution that respects the matrix conjugation invariance. We use the Haar measure on , which is the uniform density over this manifold that is symmetric under gauge symmetry [3]. The volume element of the Haar measure is given for an as . We can sample from and compute the log probabilities with respect to this distribution efficiently with standard matrix computations [32].
5.3 Training Paradigms for Equivariant Manifold Flows
There are two notable ways in which we can use the model described in Section 5.1. Namely, we can use it to learn to sample from a distribution for which we have a density function, or we can use it to learn the density given a way to sample from the distribution. These training paradigms are useful in different contexts, as we will see in Section 6.
Learning to sample given an exact density.
In certain settings, we are given an exact density and the task is to learn a tractable sampler for the distribution. For example in Boyda et al. [3], we are given conjugation-invariant densities on for which we know the exact density function (without knowledge of any normalizing constants). In contrast to procedures for normalizing flow training that use negative log-likelihood based losses, we do not have access to samples from the target distribution. Instead, we train our models by sampling from the Haar distribution on , computing the KL divergence between the probabilities that our model assigns to these samples and the probabilities of the target distribution evaluated at these samples, and backpropagating from this KL divergence loss. When this loss is minimized, we can sample from the target distribution by sampling the prior, then forwarding the prior samples through our model. In the context of Boyda et al. [3], such a flow-based sampler is important for modelling gauge theories.
Learning the density given a sampler.
In other settings, we are given a way to sample from a target distribution and want to learn the precise density for downstream tasks. For this setting, we sample the target distribution, use our flow to map it to a tractable prior, and use a negative log-likelihood-based loss. The flow will eventually learn to assign higher probabilities in sampled regions, and in doing so, will learn to approximate the target density.
6 Experiments


In this section, we utilize instantiations of equivariant manifold flows to learn densities over various manifolds of interest that are invariant to certain symmetries. First, we construct flows on that are invariant to conjugation by ; these are useful for lattice quantum field theory [3]. In this setting, our model outperforms the construction of Boyda et al. [3].
As a second application, we model asteroid impacts on Earth by constructing flow models on that are invariant to the isotropy group that fixes the north pole. Our approach is able to overcome dataset bias, as only land impacts are reported in the dataset.
Finally, to demonstrate the need for enforcing equivariance of flow models, we directly compare our flow construction with a general purpose flow while learning a density with an inherent symmetry. The densities we decided to use for this purpose are sphere densities that are invariant to action by the isotropy group. Our model is able to learn these densities much better than previous manifold ODE models that do not enforce equivariance of flows [29], thus showing the ability of our model to leverage the desired symmetries. In fact, even on simple isotropy-invariant densities, our model succeeds while the free model without equivariance fails.
6.1 Gauge Equivariant Neural Network Flows
Learning gauge equivariant neural network flows is important for obtaining good flow-based samplers of densities on useful for lattice quantum field theory [3]. We compare our model for gauge equivariant flows (Section 5.2.2) with that of Boyda et al. [3]. For the sake of staying true to the application area, we follow the framework of Boyda et al. [3] in learning densities on that are invariant to conjugation by . In particular, our goal is to learn a flow to model a target distribution so that we may efficiently sample from it.
As mentioned above in Section 5.3, this setting follows the first paradigm in which we are given exact density functions and learn how to sample.
For the actual architecture of our equivariant manifold flows, we parameterize our potentials as DeepSet networks on eigenvalues as detailed in Section 5.2.2. The prior distribution for our model is also the Haar (uniform) distribution on . Further training details are given in Appendix C.1.
6.1.1
Figure 2(a) displays learned densities for our model and the model of Boyda et al. [3] in the case of three particular densities on described in Appendix C.2.1. While both models match the target distributions well in high-density regions, we find that our model exhibits a considerable improvement in lower-density regions, where the tails of our learned distribution decay faster. By contrast, the model of Boyda et al. [3] seems to be unable to reduce mass near , a possible consequence of their construction. Even in high-density regions, our model appears to vary smoothly, with fewer unnecessary bumps and curves when compared to the densities of the model in Boyda et al. [3].
6.1.2
Figure 2(b) displays learned densities for our model and the model of Boyda et al. [3] in the case of three particular densities on described in Appendix C.2.2. In this case, we see that our models fit the target densities more accurately and better respect the geometry of the target distribution. Indeed, while the learned densities of Boyda et al. [3] are often sharp and have pointed corners, our models learn densities that vary smoothly and curve in ways that are representative of the target distributions.

6.2 Asteroid Impact Dataset Bias Correction
We also showcase our model’s ability to correct for dataset bias. In particular, we consider the test case of modelling asteroid impacts on Earth. Towards this end, many preexisting works have compiled locations of previous asteroid impacts [31, 14], but modelling these datasets is challenging since they are inherently biased. In particular, all recorded impacts are found on land. However, ocean impacts are also dangerous [42] and should be properly modelled. To correct for this bias, we note that the distribution of asteroid impacts should be invariant with respect to the rotation of the Earth. We apply our isotropy invariant flow (described in Section 5.2.1) to model the asteroid impact locations given by the dataset Meteorite Landings [31] 666This dataset was released by NASA without a specified license.. Training happens in the setting of the second paradigm described in Section 5.3, since we can easily sample the target distribution and aim to learn the density. We visualize our results in Figure 3.
6.3 Modelling Invariance Matters
We also show that our equivariant condition on the manifold flow matters for efficient and accurate training when the target distribution is invariant. In particular, we again consider the sphere under the action of the isotropy group. We try to learn the isotropy invariant density given in Figure 4(a) and compare the results of our equivariant flow against those of a predefined manifold flow that does not explicitly model the symmetry [29]. While other manifold flow models have been proposed for the sphere [38], NMODE outperforms them [29], so we use NMODE as a strong baseline. We train for 100 epochs with a learning rate of and a batch size of ; our results are shown in Figure 4.
Despite our equivariant flow having fewer parameters (as both flows have the same width and the equivariant flow has an input dimension of ), our model is able to capture the distribution much better than NMODE [29]. This is due to the inductive bias of our equivariant model which explicitly leverages the underlying symmetry.
7 Conclusion
In this work, we introduce equivariant manifold flows in a fully general context and provide the necessary theory to ensure our construction is principled. We also demonstrate the efficacy of our approach in the context of learning conjugation invariant densities over and , which is an important task for sampling lattice gauge theories in quantum field theory. In particular, we show that our method can more naturally adhere to the geometry of the target densities when compared to prior work while being more generally applicable. We also present an application to modelling asteroid impacts and demonstrate the necessity of modelling existing invariances by comparing against a regular manifold flow.
Further considerations. While our theory and implementations have utility in very general settings, there are still some limitations that could be addressed in future work. Further research may focus on finding other ways to generate equivariant manifold flows that do not rely on the construction of an invariant potential, and perhaps additionally on showing that such methods are sufficiently expressive to learn over open manifolds. Our models also require a fair bit of tuning to achieve results as strong as we demonstrate. Finally, we note that our theory and learning algorithm are too abstract for us to be sure of the future societal impacts. Still, we advance the field of deep generative models, which is known to have potential for negative impacts through malicious generation of fake images and text. Nevertheless, we do not expect this work to have negative effects in this area, as our applications are not in this domain.
Acknowledgements
We would like to thank Facebook AI for funding equipment that made this work possible. In addition, we thank the National Science Foundation for awarding Prof. Christopher de Sa a grant that helps fund this research effort (NSF IIS-2008102) and for supporting Aaron Lou with a graduate student fellowship. We would also like to acknowledge Jonas Köhler and Denis Boyda for their useful insights.
References
- Abel [1824] Niels Henrik Abel. Mémoire sur les équations algébriques, où on demontre l’impossibilité de la résolution de l’équation générale du cinquième dégré. 1824.
- Bose et al. [2020] Joey Bose, Ariella Smofsky, Renjie Liao, Prakash Panangaden, and Will Hamilton. Latent variable modelling with hyperbolic normalizing flows. In Proceedings of the 37th International Conference on Machine Learning, pages 1045–1055, 2020.
- Boyda et al. [2020] Denis Boyda, Gurtej Kanwar, Sébastien Racanière, Danilo Jimenez Rezende, Michael S Albergo, Kyle Cranmer, Daniel C Hackett, and Phiala E Shanahan. Sampling using gauge equivariant flows. arXiv preprint arXiv:2008.05456, 2020.
- Bronstein et al. [2021] Michael M. Bronstein, Joan Bruna, Taco Cohen, and Petar Velivcković. Geometric deep learning: Grids, groups, graphs, geodesics, and gauges. arXiv preprint arXiv:2104.13478, 2021.
- Bump [2004] Daniel Bump. Lie groups. Springer, 2004.
- Chen et al. [2018] Ricky T. Q. Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. In Advances in Neural Information Processing Systems, volume 31, pages 6571–6583, 2018.
- Cohen and Welling [2016] Taco Cohen and Max Welling. Group equivariant convolutional networks. In Proceedings of The 33rd International Conference on Machine Learning, pages 2990–2999, 2016.
- Cohen et al. [2019] Taco Cohen, Maurice Weiler, Berkay Kicanaoglu, and Max Welling. Gauge equivariant convolutional networks and the icosahedral CNN. In Proceedings of the 36th International Conference on Machine Learning, pages 1321–1330, 2019.
- Cohen et al. [2018] Taco S. Cohen, Mario Geiger, Jonas Köhler, and Max Welling. Spherical CNNs. In International Conference on Learning Representations, 2018.
- Dinh et al. [2017] Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. In International Conference on Learning Representations, 2017.
- do Carmo [1992] Manfredo Perdigão do Carmo. Riemannian geometry / Manfredo do Carmo ; translated by Francis Flaherty. Mathematics. Theory and applications. Birkhäuser, Boston, 1992. ISBN 0817634908.
- Donnelly [2006] Harold G. Donnelly. Eigenfunctions of the laplacian on compact riemannian manifolds. Asian Journal of Mathematics, 10:115–126, 2006.
- Durkan et al. [2019] Conor Durkan, Artur Bekasov, Iain Murray, and George Papamakarios. Neural spline flows. In Advances in Neural Information Processing Systems, volume 32, 2019.
- [14] Earth Impact Database. Earth impact database, 2011. Retrieved from http://passc.net/EarthImpactDatabase.
- Falorsi and Forré [2020] Luca Falorsi and Patrick Forré. Neural ordinary differential equations on manifolds. arXiv preprint arXiv:2006.06663, 2020.
- Feiten et al. [2013] Wendelin Feiten, Muriel Lang, and Sandra Hirche. Rigid motion estimation using mixtures of projected gaussians. Proceedings of the 16th International Conference on Information Fusion, pages 1465–1472, 2013.
- Field [1980] MJ Field. Equivariant dynamical systems. Transactions of the American Mathematical Society, 259(1):185–205, 1980.
- Finzi et al. [2020] Marc Finzi, Samuel Stanton, Pavel Izmailov, and Andrew Gordon Wilson. Generalizing convolutional neural networks for equivariance to lie groups on arbitrary continuous data. In International Conference on Machine Learning, pages 3165–3176. PMLR, 2020.
- Gallier and Quaintance [2020] Jean Gallier and Jocelyn Quaintance. Differential Geometry and Lie Groups: A Computational Perspective, volume 12. Springer, 2020.
- Goodfellow et al. [2014] Ian J Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Proceedings of the 27th International Conference on Neural Information Processing Systems - Volume 2, page 2672–2680, 2014.
- Grathwohl et al. [2019] Will Grathwohl, Ricky T Q Chen, Jesse Bettencourt, and David Duvenaud. Scalable reversible generative models with free-form continuous dynamics. In International Conference on Learning Representations, 2019.
- Hamelryck et al. [2006] Thomas Hamelryck, John T Kent, and Anders Krogh. Sampling realistic protein conformations using local structural bias. PLoS Computational Biology, 2(9), 2006.
- Kingma and Ba [2015] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015.
- Kingma and Welling [2014] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In International Conference on Learning Representations, 2014.
- Kobyzev et al. [2020] Ivan Kobyzev, Simon Prince, and Marcus Brubaker. Normalizing flows: An introduction and review of current methods. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020.
- Köhler et al. [2020] Jonas Köhler, Leon Klein, and Frank Noe. Equivariant flows: Exact likelihood generative learning for symmetric densities. In Proceedings of the 37th International Conference on Machine Learning, pages 5361–5370, 2020.
- Kondor and Trivedi [2018] Risi Kondor and Shubhendu Trivedi. On the generalization of equivariance and convolution in neural networks to the action of compact groups. In Proceedings of the 35th International Conference on Machine Learning, pages 2747–2755, 2018.
- Lee [2013] John M Lee. Introduction to Smooth Manifolds. Graduate Texts in Mathematics. Springer New York, 2013.
- Lou et al. [2020] Aaron Lou, Derek Lim, Isay Katsman, Leo Huang, Qingxuan Jiang, Ser-Nam Lim, and Christopher De Sa. Neural manifold ordinary differential equations. In Advances in Neural Information Processing Systems, volume 33, pages 17548–17558, 2020.
- Mathieu and Nickel [2020] Emile Mathieu and Maximilian Nickel. Riemannian continuous normalizing flows. In Advances in Neural Information Processing Systems, volume 33, pages 2503–2515, 2020.
- [31] Meteorite Landings. Meteorite landings dataset, March 2017. Retrieved from https://data.world/nasa/meteorite-landings.
- Mezzadri [2007] Francesco Mezzadri. How to generate random matrices from the classical compact groups. Notices of the American Mathematical Society, 54:592–604, 2007.
- Nagano et al. [2019] Yoshihiro Nagano, Shoichiro Yamaguchi, Yasuhiro Fujita, and Masanori Koyama. A wrapped normal distribution on hyperbolic space for gradient-based learning. In Proceedings of the 36th International Conference on Machine Learning, pages 4693–4702, 2019.
- Papamakarios et al. [2021] George Papamakarios, Eric Nalisnick, Danilo Jimenez Rezende, Shakir Mohamed, and Balaji Lakshminarayanan. Normalizing flows for probabilistic modeling and inference. Journal of Machine Learning Research, 22(57):1–64, 2021.
- Paszke et al. [2017] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zach DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. In Neural Information Processing System Autodiff Workshop, 2017.
- Paszke et al. [2019] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32:8026–8037, 2019.
- Rezende et al. [2019] Danilo Jimenez Rezende, Sébastien Racanière, Irina Higgins, and Peter Toth. Equivariant hamiltonian flows. arXiv preprint arXiv:1909.13739, 2019.
- Rezende et al. [2020] Danilo Jimenez Rezende, George Papamakarios, Sebastien Racaniere, Michael Albergo, Gurtej Kanwar, Phiala Shanahan, and Kyle Cranmer. Normalizing flows on tori and spheres. In Proceedings of the 37th International Conference on Machine Learning, pages 8083–8092, 2020.
- Risken and Frank [1996] Hannes Risken and Till Frank. The Fokker-Planck Equation: Methods of Solution and Applications. Springer Series in Synergetics. Springer Berlin Heidelberg, 1996.
- Skopek et al. [2020] Ondrej Skopek, Octavian-Eugen Ganea, and Gary Bécigneul. Mixed-curvature variational autoencoders. In International Conference on Learning Representations, 2020.
- Wang et al. [2019] Wei Wang, Zheng Dang, Yinlin Hu, Pascal Fua, and Mathieu Salzmann. Backpropagation-friendly eigendecomposition. In Advances in Neural Information Processing Systems, volume 32, 2019.
- Ward and Asphaug [2003] Steven N Ward and Erik Asphaug. Asteroid impact tsunami of 2880 March 16. Geophysical Journal International, 153(3):F6–F10, 2003.
- Wasserman [1969] Arthur G Wasserman. Equivariant differential topology. Topology, 8(2):127–150, 1969.
- Wirnsberger et al. [2020] Peter Wirnsberger, Andrew J Ballard, George Papamakarios, Stuart Abercrombie, Sébastien Racanière, Alexander Pritzel, Danilo Jimenez Rezende, and Charles Blundell. Targeted free energy estimation via learned mappings. The Journal of Chemical Physics, 153(14):144112, 2020.
- Zaheer et al. [2017] Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Russ R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems, volume 30, pages 3391–3401, 2017.
Appendix
Appendix A Proof of Theorems
In this section, we restate and prove the theorems in Section 4. These give the theoretical foundations that we use to build our models. Prior work [43, 17] addresses some of the results we formalize below.
A.1 Proof of Theorem 1
Theorem 1.
Let be a Riemannian manifold and be its group of isometries (or an isometry subgroup). If is a smooth -invariant function, then the following diagram commutes for any :
or . This is condition is also tight in the sense that it only occurs if is the group of isometries.
Proof.
We first recall the Riemannian gradient chain rule:
where is the “adjoint" given by
Since is an isometry, we also have
Combining the above two equations gives
which implies for all ,
Since is a Riemannian metric (even pseudo-metric works due to non-degeneracy), we must have that .
To complete the proof, we recall that , and this combined with chain rule gives
Now applying on both sides gives
which is exactly what we want to show.
We see that this is an “only if" condition because we must necessarily get that the adjoint is the inverse, which implies that is an isometry. ∎
A.2 Proof of Theorem 2
Theorem 2.
Let be a Riemannian manifold, and be its isometry group (or one of its subgroups). Let be any time-dependent vector field on , and be the flow of . Then is an -equivariant vector field if and only if is a -equivariant flow for any .
Proof.
-equivariant -equivariant . We invoke the following lemma from Lee [28, Corollary 9.14]:
Lemma 1.
Let be a diffeomorphism. If is a smooth vector field over and is the flow of X, then the flow of ( is another notation for the differential of ) is , with domain for each .
Examine and its action on . Since is -equivariant, we have for any ,
so it follows that . Applying the lemma above, we get:
and, by simplifying, we get that , as desired.
-equivariant -equivariant . This direction follows from the chain rule. If is -equivariant, then at all times we have:
(definition) | ||||
(chain rule) | ||||
(equivariance) | ||||
(definition) |
This concludes the proof of the backward direction. ∎
A.3 Proof of Theorem 3
Theorem 3.
Let be a Riemannian manifold, and be its isometry group (or one of its subgroups). If is a -invariant density on , and is a -equivariant diffeomorphism, then is also -invariant.
Proof.
We wish to show is also -invariant, i.e. for all .
We first recall the definition of :
Since is -equivariant, we have for any . Also, since is -invariant, we have . Combining these properties, we see that:
(expanding definition of ) | ||||
(expanding Jacobian) | ||||
(rearrangement) | ||||
(expanding definition of ) |
Now note that is contained in the isometry group, and thus is an isometry. This means for any , so the right-hand side above is simply , which proves the theorem. ∎
A.4 Proof of Theorem 4
Theorem 4.
Let be a closed Riemannian manifold. Let be a smooth, non-vanishing distribution over , which will act as our target distribution. Let be a distribution over said manifold parameterized by a real time variable , with acting as the initial distribution. Let denote the Kullback–Leibler divergence between distributions and . If we choose a such that
and if evolves with as the distribution of a flow according to , it follows that
implying convergence of to in . Moreover, the exact diffeomorphism that takes us from is as follows. Given some initial point , let be the solution to the initial value problem given by:
The desired diffeomorphism maps to .
Proof.
1) Derivative of . We start by noting the following: by the Fokker-Planck equation, evolving as a flow according to is equivalent to
Please observe that since is defined as being a solution to the Fokker-Planck equation [39], will be a family of densities. In particular, the Fokker-Planck equation describes the time evolution of a probability density function.
Keeping Fokker-Planck in mind, we obtain the following expression for the time derivative of :
where the final equality follows from the divergence theorem, since the integral of the divergence over a closed manifold is . Now if we choose such that:
Then we have:
2) Proof of convergence. Consider:
where is defined as above. Note by standard existence and uniqueness results for differential equations on manifolds (for example, see do Carmo [11]) we have the existence of a solution, for all time , to this differential equation with initial value .
Now note , expressed as a function of , is an invariant potential, the flow of which maps to . By the result above, we know the right-hand-side of the equation:
must approach (since the -divergence cannot continue decreasing at any constant rate, as it must be non-negative). The only way the right-hand-side can be is when , which can occur only when . This concludes the proof of convergence of in .
3) Showing diffeomorphism is well-defined. The exact diffeomorphism from is as follows. Given some initial point , let be the solution to the initial value problem given by:
is defined as before. Note exists and is unique by standard differential equation uniqueness and existence results [11]. We claim the desired diffeomorphism maps to . All that remains is to show (a) convergence to a smooth function at the limit and (b) that equivariance of the diffeomorphism does not break at the limit. We begin by showing this for uniform and finish the proof by extending to general.
uniform. For simplicity, we first consider the case where is the uniform (Haar) measure. In this case, the differential equation that obeys reduces to the heat equation, namely:
(a) Please note the following: an important fact that makes harmonic analysis on compact manifolds possible is that the spectrum of the Laplacian on any compact manifold must be discrete, i.e. its eigenvalues are countable and tend to infinity [12]. Also, its eigenvectors must be smooth (intuitively this says harmonic analysis is “nice" on manifolds in the same way that Fourier analysis is nice on the unit circle).
Note also that the Laplacian is Hermitian and negative semidefinite, and moreover that the only eigenfunction for eigenvalue is the constant vector.
Both facts above imply the solution to the above differential equation will just be the sum of several exponentially decaying (in ) terms and a constant term, given by the harmonic expansion of .
From here, it follows that the distance between and the constant potential is just the sum of squares of the coefficients in front of those terms (this is simply the manifold analog of Parseval’s theorem). However, all of those terms are decaying exponentially, so it follows that converges in the norm to the constant potential777Please note that if we wanted some other type of convergence, e.g. pointwise convergence, we could get this as well using a similar argument, by analyzing the decay properties of the eigenvalues/eigenvectors of the Laplacian..
(b) Additionally, note that if the initialization is -invariant, then it is fairly easy to see that all the terms in its harmonic expansion must also be -invariant. As a result, must be -invariant at all times, and must remain -invariant in the limit. Similarly, its flow must be -equivariant.
general. We have shown the desired properties for the case of uniform. However, the general case is entirely analogous, as the modified operator (involving ) has all the same relevant properties as the Laplacian (it is just generally better known that the Laplacian has these properties).
∎
A.5 Conjugation by is an Isometry
We now prove a lemma that shows that the group action of conjugation by is an isometry subgroup. This implies that Theorems 1 through 3 above can be specialized to the setting of .
Lemma 2.
Let be the group action of conjugation by , and let each represent the corresponding action of conjugation by . Then is an isometry subgroup.
Proof.
We first show that the matrix conjugation action of is unitary. For , note that the action of conjugation is given by . We have that is unitary because:
(conjugate transposes distribute over ) | |||
(mixed-product property of ) | |||
(simplification) |
Now choose an orthonormal frame of . Note that locally consists of shifts of the algebra, which itself consists of traceless skew-Hermitian matrices [19]. We show is an isometry subgroup by noting that when it acts on the frame, the resulting frame is orthonormal. Let , and consider the result of action of on the frame, namely . Then we have:
Note for , we have and for we see . Hence the resulting frame is orthonormal and is an isometry subgroup. ∎
Appendix B Manifold Details for the Special Unitary Group
In this section, we give a basic introduction to the special unitary group and relevant properties.
Definition. The special unitary group consists of all -by- unitary matrices (i.e. for the conjugate transpose of ) that have determinant .
Note that is a smooth manifold; in particular, it has Lie structure [19]. Moreover, the tangent space at the identity (i.e. the Lie algebra) consists of traceless skew-Hermitian matrices [19]. The Riemannian metric is .
B.1 Haar Measure on
Haar Measure. Haar measures are generic constructs of measures on topological groups that are invariant under group operation. For example, the Lie group has Haar measure , which is defined as the unique measure such that for any , we have
for all and .
A topological group together with its unique Haar measure defines a probability space on the group. This gives one natural way of defining probability distributions on the group, explaining its importance in our construction of probability distributions on Lie groups, specifically .
To make the above Haar measure definition more concrete, we note from Bump [5, Proposition 18.4] that we can transform an integral over with respect to the Haar measure into integrating over the corresponding diagonal matrices under eigendecomposition:
Thus, we can think of the Haar measure as inducing the change of variables with volume element
To sample uniformly from the Haar measure, we just need to ensure that we are sampling each with probability proportional to .
Sampling from the Haar Prior. We use Algorithm 1 [32] for generating a sample uniformly from the Haar prior on :
Sample where each entry for independent random variables .
Let be the QR Factorization of .
Let .
Output as distributed with Haar measure.
B.2 Eigendecomposition on
One main step in the invariant potential computation for is to derive formulas for the eigendecomposition of as well as formulas for double differentiation through the eigendecomposition (recall that we must differentiate the -invariant potential to get -equivariant vector field and another time to produce gradients to optimize this). During the initial submission of our paper, a general implementation of this for complex matrices did not exist. Furthermore, while various specialized numerical techniques have been developed [41] to perform this computation, the implementation of these was unnecessary for our test cases of . Instead, we derived explicit formulas for the eigenvalues based on finding roots of the characteristic polynomials (given by root formulas for quadratic/cubic equations). Note that this procedure does not scale to higher dimensions since there does not exist a closed form solution for [1]. However, concurrently released versions of PyTorch [36] introduced twice differentiable complex eigendecomposition, allowing one to easily extend our methods to higher dimensions.
B.2.1 Explicit Formula for
We now derive an explicit eigenvalue formula for the case. Let us denote for such that as an element of ; then the characteristic polynomial of this matrix is given by
and thus its eigenvalues are given by
Remark. We note that there is a natural isomorphism , given by
We can exploit this isomorphism by learning a flow over with a regular manifold flow like NMODE [29] and mapping it to a flow over . This is also an acceptable way to obtain stable density learning over .
B.2.2 Explicit Formula for
We now derive an explicit eigenvalue formula for the case. For the case of , we can compute the characteristic polynomial as
where
Now to solve the equation
we first transform it into a depressed cubic
where we make the transformation
Now from Cardano’s formula, we have the cubic roots of the depressed cubic given by
where the two cubic roots in the above equation are picked such that they multiply to .
Appendix C Experimental Details for Learning Equivariant Flows on
This section presents some additional details regarding the experiments that learn invariant densities on in Section 6.
For the evaluation, we found that ESS (effective sample size) was not a good metric to compare learned densities in this context. In particular, we noticed that several degenerate (mode collapsed) densities were able to attain near perfect ESS while completely failing on matching the target distribution geometry. Given that Boyda et al. [3] did not release code and reported ESS only for certain test cases, we decided to exclude ESS as a metric from our paper and instead relied directly on distribution geometry visualization.
C.1 Training Details
Our DeepSet network [45] consists of a feature extractor and regressor. The feature extractor is a -layer tanh network with hidden channels. We concatenate the time component to the sum component of the feature extractor before feeding the resulting size tensor into a -layer tanh regressor network.
To train our flows, we minimize the KL divergence between our model distribution and the target distribution [34], as is done in Boyda et al. [3]. In a training iteration, we draw a batch of samples uniformly from , map them through our flow, and compute the gradients with respect to the batch KL divergence between our model probabilities and the target density probabilities. We use the Adam stochastic optimizer for gradient-based optimization [23]. The graph shown in Figure 2 was trained for iterations with a batch size of and weight decay setting of ; the starting learning rate for Adam was , and a multi-step learning rate schedule that decreased the learning rate by a factor of every epochs was used. We use PyTorch to implement our models and run experiments [36]. Experiments are run on one CPU and/or GPU at a time, where we use one NVIDIA RTX 2080Ti GPU with 11 GB of GPU RAM.
We note that during our implementation, there are specific parts of the code that involved careful tuning for effective training. Specifically, we perturbed the results of certain functions and gradients by small constants to ensure numerical stability of the training process. We also spent some time tuning the learning rate and some ODE settings. More details can be found in the accompanying Github code.
C.2 Conjugation-Invariant Target Distributions
Boyda et al. [3] defined a family of matrix-conjugation-invariant densities on as:
which is parameterized by scalars and . The normalizing constant is chosen to ensure that is a valid probability density with respect to the Haar measure.
More specifically, the experiments of Boyda et al. [3] focus on learning to sample from the distribution with the above density with three components, in the following form:
We tested on three instances of the density, also used in Boyda et al. [3]:
set | ||||
---|---|---|---|---|
1 | 0.98 | -0.63 | -0.21 | 9 |
2 | 0.17 | -0.65 | 1.22 | 9 |
3 | 1 | 0 | 0 | 9 |
Note that the rows of Figure 2 correspond to coefficient sets , given in order from top to bottom.
C.2.1 Case for
In the case of , we can represent the eigenvalues of a matrix in the form for some angle . We then have , so above density takes the form:
C.2.2 Case for
In the case of , we can represent the eigenvalues of in the form . Thus, we have
and thus
Appendix D Learning Continuous Normalizing Flows over Manifolds with Boundary
Motivation. Recall that learning a continuous normalizing flow over a manifold with boundary is not principled, and is rather numerically unstable, since probability mass can “flow out" on the boundary. In particular we noted in Section 1 that this was a major problem for the quotient manifold approach to learning invariant densities, since the quotient frequently has a nonempty boundary.
Our Approach. Our method enables learning flows over manifolds with boundary. One need only represent the manifold with boundary as a quotient of a larger manifold without boundary and learn with an invariant potential function that ensures the density descends smoothly from the larger manifold without boundary to the manifold with boundary.
Example. For instance, one can use our method to construct a flow over an interval. Notice that we can view an interval as a manifold with boundary. The boundary consists of the two endpoints, . To use our method to learn a flow over this interval, we need only represent as the quotient of by the isotropy group at the north pole, then apply the flow construction described in Section 5.2.1. The learned density assigns the same value to all points at the same latitude: clearly, this descends to a density over by taking one representative point from each latitude circle. Notice that this works more generally: we can represent various manifolds with boundary as quotients of larger manifolds by isotropy groups. In particular, one can imagine using this method to replace neural spline flows [13], which carefully constructs noncontinuous normalizing flows over intervals.