VQ-Flows: Vector Quantized Local Normalizing Flows
Abstract
Normalizing flows provide an elegant approach to generative modeling that allows for efficient sampling and exact density evaluation of unknown data distributions.
However, current techniques have significant limitations in their expressivity when the data distribution is supported on a lowdimensional manifold or has a non-trivial topology.
We introduce a novel statistical framework for learning a mixture of local normalizing flows as “chart maps” over the data manifold.
Our framework augments the expressivity of recent approaches while preserving the signature property of normalizing flows, that they admit exact density evaluation.
We learn a suitable atlas of charts for the data manifold via a vector quantized autoencoder (VQ-AE) and the distributions over them using a conditional flow.
We validate experimentally that our probabilistic framework enables existing approaches to better model data distributions over complex manifolds.
INTRODUCTION
Generative modeling is a machine learning paradigm that aims to learn data distributions and sample from it.
If the data is drawn from a random variable x ∼ p ( x ) , then one way to do this is to directly model p ( x ) via a parameterized model ( θ ) so that p θ ( x ) ≈ p ( x ) .
Such a model can then be used to generate new samples, which are expected to be statistically indistinguishable from the observed samples.
Moreover, generative models that learn p ( x ) are useful for data augmentation, outlier detection, domain transfer [1, 2], and as priors for other downstream tasks [3, 4, 5]. [Table]
Among the most successful generative models are deep latent variable models, which assume that the latent factors of variation underlying the generative process of the data follow a simple distribution, such as a Gaussian or a uniform distribution.
The non-linear function transforming this latent space to the data space (or vice-versa) is parameterized as a neural network and learned using gradient descent.
Depending upon their formulation, there are three broad categories of deep latent variable models - GANs [6], VAEs [7], and normalizing flows.
In this work, we focus on normalizing flows, a class of deep latent variable models introduced in [8] that support efficient sampling, exact density estimation, and inference [9].
A normalizing flow maps the data space to a latent space through a series of diffeomorphisms (differentiable, bijective transformations with differentiable inverses).
The data is assumed to follow an analytically computable distribution in the latent space, typically a Gaussian.
Since the mapping is a diffeomorphism, the density in the data space can be obtained using the change of variables formula.
To generate new samples using a flow, one can sample from the latent distribution and use the inverse transformation to map them to the data space.
This makes normalizing flows powerful generative models that support exact density evaluation in contrast to GANs and VAEs.
Despite the advantages of normalizing flows over other generative models, their diffeomorphic requirement poses several restrictions.
Firstly, a continuous bijective transformation with continuous inverse preserves the topology of its domain.
Therefore, the data space is required to be topologically equivalent to the support of the latent distribution, typically to D dimensional Euclidean space since the latent distribution is assumed to be a Gaussian.
However, real data distributions typically differ from Euclidean space in many topological respects, such as the number of connected components, the presence of holes, etc.
A normalizing flow would thus fail to model such data distribution accurately.
Note, as an aside, that other generative models like GANs also suffer from these topological issues [10].
[Figure] A particularly troubling consequence of the continuous invertibility of flow transformations is that they are dimensionality preserving.
However, according to the manifold hypothesis , high dimensional real-world data living in X ≃ R D is often supported on a d << D manifold of the embedding space.
To efficiently learn such distributions using flows, one needs to design expressive transformations that can map from a d dimensional latent space to a the D dimensional data space without making learning intractable.
Recent work using stochastically invertible tall matrices [11] and dimension raising conformal embeddings [12] have paved the way in designing such transformations, however in both works expressivity is limited by the fact that the dimension changing operations are restricted to be linear (in [11]) or made up of Möbius transformations (in [12]).
In this work, we propose to address the above limitations by parameterizing a family of normalizing flows to compose an atlas of charts over the data manifold.
As the topology of the data manifold is expected to be “locally” equivalent to
Euclidean space, a local normalizing flow should be able to model the local distribution over a chart region effectively.
Further, by learning a mixture of flows over well-chosen charts, our approach compensates naturally for the limited expressiveness of existing flows.
We summarize the main contributions of this work below:
• We provide an understanding of the limited expressive power of existing flow-based models in modeling data distributions over complex topological spaces.
• We present a statistical framework for defining an expressive mixture of local normalizing flows that is flexible and generic enough to be used with existing approaches.
We show that this framework allows for efficient sampling, inference of latent variables, and exact density evaluation while improving expressivity.
• We validate experimentally that the proposed approach improves flows for density estimation and sample generation, and is thus able to resolve many
of the topological restrictions on expressivity imposed by using global diffeomorphisms.
BACKGROUND
Given data { x n } Nn =1 ⊂ X ≃ R D distributed according to an unknown distribution p ( x ) , a normalizing flow maps it through a diffeomorphism f : X → Z to a latent space Z ≃ R D such that z = f ( x ) is simply distributed, for example z ∼ q ( z ) where q = N (0 , I ) .
Recall that a diffeomorphism is a differentiable map that is bijective and whose inverse is also differentiable.
Typically one denotes by g the inverse of f and parameterizes the normalizing flow as x = g θ ( z ) , where θ is the vector of learnable model parameters.
The process of going from the latent space to data space is called generation or sampling and is accomplished by the function g θ , while the inverse procedure is termed inference and is accomplished by f θ = g [Equation]
[Equation]
Inference
[Equation]
The approximation p θ ( x ) to the true probability density p ( x ) is then obtained from q ( z ) through the change of variables formula as:
[Equation]
As compositions of diffeomorphisms are also diffeomorphisms, one can design expressive flows by composing individual transformations that have simple to compute inverses and Jacobian determinants.
Suppressing the vector of model parameters θ , we will use the notation f ( x ) =
f 1 ◦ · · · ◦ f L ( x ) where f 1 , . . .
, f L are assumed to have easily computable Jacobian determinants and inverses.
Define recursively x
l − 1 = f l ( x l ) , 1 ≤ l ≤ L , with x L = x .
Note that x l = f l +1 ◦ · · · ◦ f L ( x ) and x 0 = f
( x ) .
One can then write the log-likelihood as:
[Equation]
A given layer f l of the normalizing flow will depend only on a subset θ l of the parameters of θ :=
( θ 1 , . .
, θ L ) .
Temporarily adding back in the θ dependence of f θ , maximum likelihood estimation of θ then yields the following optimization problem:
[Equation]
RELATED WORK
Normalizing flows have come a long way since it was introduced in [9, 13], with much efforts focused on expanding their scalability and applicability.
This has resulted in several different formulations [14, 15, 16, 17], each with a multitude of proposed architectures [18, 19, 20, 21, 22, 23], aimed at defining expressive yet analytically invertible flow transformations with efficiently computable jacobian determinants.
However, as these approaches define invertible transformations in Euclidean space, they are dimensionality preserving and less suited for modeling distributions over lower dimensional manifolds [24, 25].
Subsequent works have tried to address this challenge by building injective flows [26, 11, 27, 28, 29, 30].
However, they trade off the benefits of dimensionality change to intractable density estimation or stochastic inverses.
The work by [12] overcomes the above limitations using conformal embeddings, but has limited expressive power, as we show in this work.
One way to improve the expressivity of all the above approaches, and enable them to overcome topological constraints [31], is to relax their global diffeomorphic requirement by defining a mixture of flows .
Prior works in this direction have looked at infinite mixtures by defining flows in a lifted space [32] or by using continuous indexing [33].
However, their added expressivity comes at the cost of tractable density computation, and one has to rely on variational approximations to train the model.
A manifold geometric approach to normalizing flows is also taken in [34] and [35], however in contrast to this work these techniques assume the manifold and its Riemannian geometry are known.
On similar lines with this work, [36] proposes to use a finite mixture of flows through piecewise-invertible transformations over partitions of the data space by introducing both real and discrete valued latent variables in the flow.
However, this formulation introduces discontinuities in the model density that leads to unstable training [33], necessitating the enforcement of boundary conditions through ad-hoc architectural changes.
It is therefore limited in its generalizability to novel flow formulations.
Our work, on the other hand, by decoupling the partition learning from the flow training, introduces a more generic and scalable framework that can aid existing flows to overcome topological constraints and learn complex data distributions efficiently.
METHODOLOGY
A traditional normalizing flow provides a global diffeomorphism between the latent space Z and the data space
X ≃ R D , and as such requires the latent space to have the same dimension as the data space.
This can lead to numerical instability when the data is supported on a d < D dimensional manifold M ⊂ X because the learned transformation will tend to become “less and less injective” as it seeks to restrict its range to M [24, 25].
One way to overcome this challenge is to build transformations that map across dimensions while preserving invertibility on its image.
Unfortunately, the natural approach of post-composing a d dimensional bijective normalizing flow g : Z → U with a dimension-raising embedding e : U → X leads in general to an intractable likelihood since the determinant in the change of variables formula p ( x ) =
q ( f ( x )) | Det [ J g J Te J e J g ] | − 12 no longer separates into a product of simpler determinants.
We will focus on the solution to this issue developed in [12], namely to post-compose the d dimensional bijective normalizing flow g : Z → U with a dimension raising conformal embedding c : U → X .
An alternative solution developed in [11] is to use a linear dimension raising embedding and invert it stochastically, but this approach relies on the dimension change operation being linear which is restrictive.
The approach taken in [12] hinges on the fact that for every u ∈ U the Jacobian J c ( u ) satisfies J c ( u ) T J c ( u ) = λ ( u )
I for λ : U → R , thus
[Equation]
This splitting keeps the likelihood computation tractable, but the requirement that M be the range of a conformal embedding is artificially restrictive.
This issue is exacerbated by the necessity of parameterizing c .
As noted in [12] the easiest way to do so is to let c
= c J ◦ · · · ◦ cwhere each c j is either a trivially conformal zero padding operation or a dimension preserving conformal transformation.
A dimension preserving conformal transformation f : R d → R d with d > 2 is restricted by Liouville’s theorem to be a Möbius transformation, of the form
[Equation]
where A ∈ O ( d ) is an orthogonal matrix, α ∈ R , a, b ∈ R d , and ϵ is either 0 or 2 .
Though it might initially appear that the composition of many such operations would give increased expressive power, the group structure of the Möbius transformations prevents this.
Indeed, if p s : R d → R d + s is the zero padding operation, m
=
( A 1 , a 1 , b 1 , α 1 , ϵ 1 ) is a d dimensional Möbius transformation and m 2 =
( A 2 , a 2 , b 2 , α 2 , ϵ 2 ) is a d + s dimensional Möbius transformation then it is easily verified that for x ∈ R d
[Equation]
Where ˜ m 1 is the d + s dimensional Möbius transformation
[Equation]
Thus, this parametrization yields c as a Möbius transformation of R D composed with p D − d .
Practically speaking, if c is parameterized as above, the assumption that M is the image of a global conformal embedding severely limits expressiveness.
The class of global conformal embeddings is not subject to Liouville’s theorem and is far richer than the set of Möbius transformations, but it is hard to parameterize.
4.1 DIFFERENTIAL GEOMETRY OF CONFORMALLY FLAT MANIFOLDS
A weaker and more natural assumption than M being the image of a conformal embedding is that M is locally conformally flat .
Recall that if f : ( N , η 1 ) → ( M , η 2 ) is a map between differentiable manifolds N and M with metrics η 1 : N × T N × T N and η 2 : M× T M× T M respectively then the pullback f ∗ η 2 of the metric η 2 through f is defined via:
[Equation]
With this in mind a d dimensional manifold M is called locally conformally flat if η 1 = (cid:80) di =1 dy 2 i is the flat metric and for any x ∈ M there is a neighborhood U ∋ x , an open set
O ⊂ R d , a diffeomorphism f : O → U , and a differentiable scalar function λ : O → R such that f ∗ η 2 ( y, · , · ) =
λ ( y ) η 1 ( · , · ) for all y ∈ O [37].
An alternate definition replaces R d with a flat manifold (defined as having an identically vanishing Riemannian curvature tensor), but this definition is equivalent to the above since any d dimensional flat manifold is locally isometric to R d (not globally isometric, for example tori are flat when equipped with appropriate coordinates)
In our case the metric η 2 is assumed to be inherited from the Euclidean metric on
X ≃ R D .
The notion of local conformal flatness provides far more flexibility than its global counterpart.
It is well known, for example, that every 2 dimensional Riemannian manifold is locally conformally flat, but even the sphere S 2 ( R ) is not globally conformally flat (by contrast an explicit local conformal equivalence of S d ( R ) to R d is given by stereographic projection from the north and south poles) [38].
In general, criteria are known for a Riemannian manifold of dimension d > 2 to be locally conformally flat: For d =a pseudo-Riemanian manifold is locally conformally flat if and only if the Cotton tensor vanishes everywhere, for d ≥a pseudo-Riemannian manifold is locally conformally flat if and only if the Weyl tensor vanishes everywhere [38].
The question of which manifolds are globally conformally flat is more difficult, and in applied problems this requirement is artificially restrictive.
4.2 LOCAL NORMALIZING FLOWS
We propose to break up the data manifold M into an atlas of overlapping charts V 1 , . .
, V K .
Definition 1 (See [37]) . An atlas of (smooth) charts for a d dimensional manifold M is a collection of subsets of M , { V k } Kk =1 and a collection of subsets { P k } Kk =1 of R d such that {+(cid:83) Kk =
+}
V k
= M and a collection of invertible maps f k : V k
→ P k such that the “transition maps” f i ◦ f − 1 j : f j ( V i ∩ V j ) → f i ( V i ∩ V j ) are smooth. We will assume charts of the form V j = U j ∩ M and P j = f j ( V j ) where U j are learned open subsets of X such that { x n } Nn =1 ⊂ (cid:83) Kk =1 U k and f 1 , . . . , f K are conformal normalizing flows.
In a slight abuse of terminology we will also refer to U 1 , . . . , U k as charts. To handle dimensionality change, we assume that the manifold M is locally conformally flat and of dimension d , implying that for V j sufficiently small there exists D k ⊂ U and a conformal dimension raising map
c k : U → X so that [Equation]
Because chart regions may in general overlap, we propose to choose between them probabilistically.
Specifically, given U 1 , . . .
, U K that cover the data manifold M , we model p ( x ) via a latent random variable z that takes values in Z and a “chart picking” discrete random variable k that takes values in { 1 , . . .
, K } .
For k = 1 , . . .
, K let g k : Z → U k be a global immersion (a differentiable injection whose Jacobian is everywhere full rank) with left inverse
f k : V k
→ Z and range V k = g k ( P k ) = M ∩ U k .
Proposition 1.
Let ( U k ) Kk =1 , ( V k ) Kk =1 , ( g k )
Kk =1 , and ( f k ) Kk
=1 be as above. Further, let k be a discrete random variable taking values 1 , . .
, K and z a continuous random variable taking values in Z . Then if x is a random variable supported on M such that
[Equation]
One has (i) The joint distribution of x and k is given by:
[Equation]
(ii) The marginals p ( k ) and p ( z ) are given by p k and q ( z ) respectively.
(iii)
The random variables z and k are independent.
(iv) The conditional distributions p ( x | k ) and p ( k | x ) are given by
[Equation]
(v) The density of interest, p ( x ) is given by
[Equation]
[Figure]
Proof.
Deferred to the appendix (see Section 7). Thus we assume the joint distribution of x , z , and k to be p ( x, z, k )
=
δ ( x − g k ( z )) q ( z ) p k and apply the above proposition. We will use either q = N (0 , I ) or q = 1 vol
[Equation]
[Equation]
1 B 1 (0) as our latent distribution and let p k be the normalized probability with which x occurs in U k , that is: [Equation]
It remains to learn a “good” collection of charts U 1 , . .
, U K , estimate p 1 , . .
, p K , and then to parameterize g 1 , . .
. , g K via normalizing flows g θ 1 , . .
. , g θK and obtain a maximum likelihood estimate for θ by optimizing − log p θ ( x ) (where p θ ( x ) is as in (13)). 4.2.1 Learning the collection of charts U 1 , . . . , U K
We learn the charts U 1 , . . .
, U K via a vector-quantized auto encoder (VQ-AE)[39], as it provides an effective and scalable mechanism to learn quantized centers on lower dimensional manifolds (also see [40] for a recent application on high-dimensional data).
The VQ-AE learns an encoder map
E : X → V , a decoder map D : V → X , and a collection of “encoded chart centers” Q = { v k } Kk =1 ⊂ V that minimize the reconstruction error
L ( D (argmin v ∈ Q || v − E ( x ) || 2 ) , x ) .
Once D , E , and Q are learned we compute
d k ( x ) =
||
E ( x ) − v k || 2 for k = 1 , . . .
K .
With d 1 ( x ) , . . .
d k ( x ) in hand it remains to compute our charts.
We would like the charts to overlap, but we also want them to be sparse in the sense that no individual x has too many relevant charts.
One possible choice is to fix m ∈ { 1 , . .
, K } and let ˜ d 1 ≤ · · ·
≤ ˜ d K be the sorted permutation of d 1 , . . .
, d K then define U k
= { x : || E ( x ) − v k || 2 ≤ ˜ d m ( x ) } , so that every point x has at least m charts associated to it (those whose encoded chart centers are among the m closest to
E ( x ) ).
With this choice, a point x will have exactly m associated charts so long as the m th closest chart center is unique.
Another choice would be to fix ϵ > 0 and let
[Figure] E n c ode r
[Equation] (increasing ϵ enlarges each chart).
For now we leave m and ϵ as hyperparameters, and in general denote m ( x ) =
|{ k : x ∈ U k }| (one always has m ( x ) ≥ m ).
Note that checking if x ∈ U k amounts to computing E ( x ) and ˜ d 1 ( x ) , . . . ,
˜ d K ( x ) and verifying that || E ( x ) − v k || 2 < (1 + ϵ ) ˜
d m ( x ) .
4.2.2 Estimating p 1 , . . . , p K
Once U 1 , . .
, U K are fixed note that if r k :=
p ( x ∈ U k ) , r k = E x ∼
[Equation]
The density p ( x ) is unknown at this point, but we may estimate r k using the empirical distribution ρ ( x ) =
N (cid:80) Nn
=1 δ ( x − x n ) so that r k ≈ E x ∼ ρ ( x ) [ 1 U k ( x )] .
Practically speaking we thus perform a second pass over the training data and update r 1 , . .
, r K (initialized as zero) via r
[Equation]
n [Equation] [Equation] n
[Equation]
N , finally setting
[Equation]
and p
[Equation]
[Equation]
4.2.3 Learning the local transformations g 1 , . . . , g K
Once U 1 , . .
, U K and p 1 , . .
. , p K are obtained we model g k : Z → U k as an L layered invertible conditional normalizing flow.
Where dimensionality change is required, we post-compose it with a conformal dimension raising map so that g k =
c k ◦ g
Lk ◦ · · · ◦ g 1 k .
We write the left inverse of g k via f k = f 1 k ◦ · · · ◦ f Lk ◦ c † k where f lk = ( g lk ) − 1 and c † k denotes the left inverse of the conformal map c obtained by removing the zero padding and inverting the various
Möbius transformations composing c k .
In practice, we reduce the number of parameters of our model by restricting each g lk (and f lk ) to depend on k only through the value of the encoded chart center v k .
With this parametrization of f 1 , . . .
, f K in hand (11) becomes
[Equation]
16) where λ k ( u ) is defined via ( Jc k ( u )) T ( Jc k ( u ))
=
λ k ( u ) 2 I .
As we’ll see this approach allows for far higher expressive power than global conformal flows without sacrificing the ability to generate realistic samples, perform inference, or compute exact densities.
Indeed we may rewrite (13) via p ( x ) = (cid:88)
[Equation]
piecewise
[Equation]
Where ˜ p
[Equation]
Thus, during training of the conditional normalizing flow we may replace the expectation E k ∼ ˜ p
( k ) [ p ( x | k )] with the stochastic quantity p ( x | k ) , k ∼ ˜ p ( k ) , performing only a single gradient descent pass per data-point as opposed to m ( x ) passes.
If the exact likelihood is needed, however, it can be computed at the cost of evaluating the normalizing flow and its Jacobian m ( x ) times:
[Equation]
Since z and k are independent, one can perform the sampling task via first sampling z ∼ q ( z ) and k ∼ p ( k ) and then computing a single forward pass of the normalizing flow chosen by k to obtain x = g k ( z ) .
The inference task is complicated slightly by the fact that z is no longer wholly determined given x , but instead takes values ( f k ( x ))
k : x ∈ U k with corresponding probabilities ( p ( k | x ))
k : x ∈ U k .
One could perform a stochastic inference via sampling k ∼ p ( k | x ) and computing z = f k ( x ) (this amounts to choosing among the relevant charts for x ), however if deterministic inference is preferred then of course one may always compute the expected value of z as z = E k ∼ p ( k | x ) [ f k ( x )]
= (cid:80) k : x ∈ U k p ( k | x ) f k ( x ) or the most probable value of z as z = f s ( x ) where s = argmax k : x ∈ U k p ( k | x ) .
4.3 HARD-BOUNDARY OR DETERMINISTIC APPROXIMATION
A particularly simple special case of the above model is the case m = 1 and ϵ = 0 , in which only a single chart is associated to a given x .
This case reduces our atlas of overlapping charts to a disjoint partition of the data manifold M .
In this case U k is exactly the subset of
X for whom E ( x ) is closest to the encoded chart center v k , and thus with the exception of x lying on the chart boundaries, the random variable k can be treated as a deterministic function of the random variable x , namely
[Equation]
Sampling in the hard-boundary case is identical to sampling in the soft-boundary case: generate samples for x by first sampling z ∼ q ( z ) and k ∼ p ( k ) and then computing x = g k ( z ) .
Inference in the hard-boundary case is unambiguous since
[Equation]
That is to say that one performs inference by first identifying which region R s contains x and then computing z = f s ( x ) .
The most significant simplification in the hard-boundary case from a computational standpoint comes in computing the likelihood p ( x ) , since if x ∈ U k then
[Equation]
Thus only one normalizing flow needs to be evaluated to compute the exact likelihood p ( x ) (as opposed to m ( x ) of them) and the normalizing flows may be trained using the exact likelihood as opposed to an unbiased estimator for it.
EXPERIMENTS
To experimentally validate the efficacy of the proposed framework, we consider six 3-dimensional data distributions over manifolds of varying complexity as shown in
Figure 4.
Each dataset consists of 10 , 000 datapoints, 5 ,of which we use for training and 2 , 500 each for validation and testing.
We train three different normalizing flowsRealNVP
[13], Masked Autoregressive Flows (MAF) [18] and Conformal Embedding Flows (CEF) [12] over these datasets with and without the augmentation of our framework.
We refer to a base flow augmented with the vector quantized conditioning as VQ- flow .
We define each model using 5 flow transformations and train them for 100 epochs using an Adam optimizer, early stopping if the validation performance does not improve over 10 epochs.
For CEF, we use a 2-dimensional RealNVP as the base flow, which is then raised to the 3-dimensional space using the conformal embedding.
We parameterize the VQ-AE using feedforward neural networks and use a latent dimension of 2 with k = 32 , to learn the partitioning of the data manifold.
To define the conditional normalizing flow, we use the parameterization given in [41].
We evaluate the models for density estimation and sample generation.
We follow the same hyperparameters for a base flow and its VQ-counterpart without any tuning and report the performance averaged over 5 independent trials.
We defer further details on data generation,
[Table] [Table]
implementation as well as results on additional 3D data distributions to the supplementary material.
5.1 DENSITY ESTIMATION
The ability to compute exact likelihood is one of the critical features of a normalizing flow that makes it a potential tool in solving inverse problems.
Improving the expressive power of flows can thus enhance their utility as priors by better modeling the data density.
Thus, we first evaluate the proposed framework’s ability to enhance the expressivity of flows to perform better density estimation.
Table 1 compares the log-likelihood (in nats) achieved by different flow models with and without the VQ-augmentation on a held-out test set.
A higher value indicates a better learned density.
We observe that VQ-flows are able to achieve higher test log-likelihoods than their non-VQ-counterparts consistently across the considered data distributions.
Thus, our framework enables better density estimation for normalizing flows over complex manifolds.
5.2 SAMPLE GENERATION
A key desiderata of an expressive generative model is its ability to generate high fidelity samples from the data distribution.
Figure 4 visualizes the samples generated by a RealNVP flow trained on the 3D data distributions with and without the VQ augmentation.
We observe that while the classical flow is able to generate samples from the data manifold, it also generates data points off the manifold, resulting in a poor fit to the real data distribution, as expected due to the requirements of being a global diffeomorphism.
VQflows are seen to overcome these restrictions and generate samples better approximating the real data distribution.
For a quantitative comparison, we evaluate the log-likelihood of the generated samples using a kernel density estimator fitted on the training data.
We use a Gaussian kernel, with an optimal bandwidth obtained through cross-validation for each data distribution.
We observe (Table 2) that VQflows, owing to their ability to model the topology of the data manifold better, significantly outperform their non-VQ counterparts on sample generation.
5.3 HIGH DIMENSIONAL DATA
To study the scalability of the proposed approach to higher dimensions, we consider the MNIST [42] dataset comprising 60,000 grayscale images of handwritten digits, each of dimension 784 (28 × 28). We train RealNVP and MAF with and without the VQ-augmentation and plot FID scores of the generated samples across their training iterations in Figure 5. We observe that VQ-flows are able to achieve better performance (lower FID scores) faster than their non-VQ counterparts, hence validating the utility of the proposed approach in higher dimensions. An interesting observation here is that while MAF results on MNIST are much better than that of RealNVP, both VQ-MAF and VQ-RealNVP converge to the similar (low) FID scores.
This early result
[Figure]
[Figure] seems to validate our hypothesis that the core difficulties (topology, dimensionality, etc), even on real datasets, can perhaps be better addressed by the proposed research direction than by improving backbone ‘single’ flow models. 5.4 ABLATION STUDY Parameterizing the partitioning function using a VQ-AE is a design choice and the no. of partitions k to consider over the data manifold is an important hyperparameter underlying the proposed framework.
We conduct an ablation study to evaluate the sensitivity of our approach on k and the partitioning method.
We consider k-means clustering as an alternative design choice for the partitioning function.
We train a RealNVP flow over the HELIX data distribution using k-means and VQ-AE, across increasing values of k .
We plot the validation log-likelihood post training forepochs as a function of k in Figure 6.
We observe that VQAE results in better performance of the flow consistently across k , over k-means.
Further, the choice of k beyond a threshold does not have any significant effect on the model, hence it is sufficient to fix it to a large enough value.
FUTURE WORK & CONCLUSION
Our framework is particularly well suited to high dimensional datasets (such as natural images) that obey the manifold hypothesis, an avenue we hope to explore in the sequel.
One of the practical issues we encountered with our approach is that training g k only on samples from U k does not always restrict the learned p ( x | k ) to be supported only on U k .
In such cases, the sum over k such that x ∈ U k in (18) yields an underestimate for p ( x ) , and the total sum k = 1 , . .
, K must be used instead during testing.
In the future, we hope to address this issue by explicitly discouraging the generation of samples outside U k .
To summarize, motivated by differential and conformal geometry, we have developed a novel probabilistic framework for “local” flows.
We have demonstrated experimentally on toy data distributions with various topological features that this framework outperforms global flows - both dimen- [Figure] sion preserving (bijective flows) and dimension raising (embedding flows).
Our framework is agnostic to the type of flow transformation employed and retains the key feature of normalizing flows: exact density evaluation.
As such, we argue that using local flows as probabilistic chart maps over the data manifold is a natural way to overcome limited expressivity in the presence of dimension change or other topological impediments.  APPENDIX Proof of Proposition 1. Proving ( i ) .
We can compute the joint distribution over x and k - p ( x, k ) as given below:
[Equation]
Proving ( ii ) .
It is readily verified that p ( z ) =
q ( z ) and p ( k ) =
p k , in particular:
[Equation]
and,
[Equation]
Proviing ( iii ) .
Taken together, (22) and (23) yield that z and k are independent random variables since,
[Equation]
Proving ( iv ) .
Dividing (21) by p ( k ) =
p k we get that the distribution of x conditioned on a particular chart is given by:
[Equation]
In particular, p ( x | k ) is zero unless x ∈ U k .
Meanwhile p ( k | x ) is given by the Bayes’ formula as:
[Equation]
Proving ( v ) .
Note that the distribution p ( k | x ) is thus also zero unless x ∈ U k , a fact that will be employed during inference.
Finally the density p ( x ) is given by:
[Equation]