A flow-based generative model is a generative model used in machine learning that explicitly models a probability distribution by leveraging normalizing flow, which is a statistical method using the change-of-variable law of probabilities to transform a simple distribution into a complex one.
The direct modeling of likelihood provides many advantages. For example, the negative log-likelihood can be directly computed and minimized as the loss function. Additionally, novel samples can be generated by sampling from the initial distribution, and applying the flow transformation.
In contrast, many alternative generative modeling methods such as variational autoencoder (VAE) and generative adversarial network do not explicitly represent the likelihood function.
Method
Let z 0 {\displaystyle z_{0}} be a (possibly multivariate) random variable with distribution p 0 ( z 0 ) {\displaystyle p_{0}(z_{0})} .
For i = 1 , . . . , K {\displaystyle i=1,...,K} , let z i = f i ( z i − 1 ) {\displaystyle z_{i}=f_{i}(z_{i-1})} be a sequence of random variables transformed from z 0 {\displaystyle z_{0}} . The functions f 1 , . . . , f K {\displaystyle f_{1},...,f_{K}} should be invertible, i.e. the inverse function f i − 1 {\displaystyle f_{i}^{-1}} exists. The final output z K {\displaystyle z_{K}} models the target distribution.
The log likelihood of z K {\displaystyle z_{K}} is (see derivation):
log p K ( z K ) = log p 0 ( z 0 ) − ∑ i = 1 K log | det d f i ( z i − 1 ) d z i − 1 | {\displaystyle \log p_{K}(z_{K})=\log p_{0}(z_{0})-\sum _{i=1}^{K}\log \left|\det {\frac {df_{i}(z_{i-1})}{dz_{i-1}}}\right|}To efficiently compute the log likelihood, the functions f 1 , . . . , f K {\displaystyle f_{1},...,f_{K}} should be easily invertible, and the determinants of their Jacobians should be simple to compute. In practice, the functions f 1 , . . . , f K {\displaystyle f_{1},...,f_{K}} are modeled using deep neural networks, and are trained to minimize the negative log-likelihood of data samples from the target distribution. These architectures are usually designed such that only the forward pass of the neural network is required in both the inverse and the Jacobian determinant calculations. Examples of such architectures include NICE,4 RealNVP,5 and Glow.6
Derivation of log likelihood
Consider z 1 {\displaystyle z_{1}} and z 0 {\displaystyle z_{0}} . Note that z 0 = f 1 − 1 ( z 1 ) {\displaystyle z_{0}=f_{1}^{-1}(z_{1})} .
By the change of variable formula, the distribution of z 1 {\displaystyle z_{1}} is:
p 1 ( z 1 ) = p 0 ( z 0 ) | det d f 1 − 1 ( z 1 ) d z 1 | {\displaystyle p_{1}(z_{1})=p_{0}(z_{0})\left|\det {\frac {df_{1}^{-1}(z_{1})}{dz_{1}}}\right|}Where det d f 1 − 1 ( z 1 ) d z 1 {\displaystyle \det {\frac {df_{1}^{-1}(z_{1})}{dz_{1}}}} is the determinant of the Jacobian matrix of f 1 − 1 {\displaystyle f_{1}^{-1}} .
By the inverse function theorem:
p 1 ( z 1 ) = p 0 ( z 0 ) | det ( d f 1 ( z 0 ) d z 0 ) − 1 | {\displaystyle p_{1}(z_{1})=p_{0}(z_{0})\left|\det \left({\frac {df_{1}(z_{0})}{dz_{0}}}\right)^{-1}\right|}By the identity det ( A − 1 ) = det ( A ) − 1 {\displaystyle \det(A^{-1})=\det(A)^{-1}} (where A {\displaystyle A} is an invertible matrix), we have:
p 1 ( z 1 ) = p 0 ( z 0 ) | det d f 1 ( z 0 ) d z 0 | − 1 {\displaystyle p_{1}(z_{1})=p_{0}(z_{0})\left|\det {\frac {df_{1}(z_{0})}{dz_{0}}}\right|^{-1}}The log likelihood is thus:
log p 1 ( z 1 ) = log p 0 ( z 0 ) − log | det d f 1 ( z 0 ) d z 0 | {\displaystyle \log p_{1}(z_{1})=\log p_{0}(z_{0})-\log \left|\det {\frac {df_{1}(z_{0})}{dz_{0}}}\right|}In general, the above applies to any z i {\displaystyle z_{i}} and z i − 1 {\displaystyle z_{i-1}} . Since log p i ( z i ) {\displaystyle \log p_{i}(z_{i})} is equal to log p i − 1 ( z i − 1 ) {\displaystyle \log p_{i-1}(z_{i-1})} subtracted by a non-recursive term, we can infer by induction that:
log p K ( z K ) = log p 0 ( z 0 ) − ∑ i = 1 K log | det d f i ( z i − 1 ) d z i − 1 | {\displaystyle \log p_{K}(z_{K})=\log p_{0}(z_{0})-\sum _{i=1}^{K}\log \left|\det {\frac {df_{i}(z_{i-1})}{dz_{i-1}}}\right|}Training method
As is generally done when training a deep learning model, the goal with normalizing flows is to minimize the Kullback–Leibler divergence between the model's likelihood and the target distribution to be estimated. Denoting p θ {\displaystyle p_{\theta }} the model's likelihood and p ∗ {\displaystyle p^{*}} the target distribution to learn, the (forward) KL-divergence is:
D KL [ p ∗ ( x ) ‖ p θ ( x ) ] = − E p ∗ ( x ) [ log p θ ( x ) ] + E p ∗ ( x ) [ log p ∗ ( x ) ] {\displaystyle D_{\text{KL}}[p^{*}(x)\|p_{\theta }(x)]=-\mathop {\mathbb {E} } _{p^{*}(x)}[\log p_{\theta }(x)]+\mathop {\mathbb {E} } _{p^{*}(x)}[\log p^{*}(x)]}The second term on the right-hand side of the equation corresponds to the entropy of the target distribution and is independent of the parameter θ {\displaystyle \theta } we want the model to learn, which only leaves the expectation of the negative log-likelihood to minimize under the target distribution. This intractable term can be approximated with a Monte-Carlo method by importance sampling. Indeed, if we have a dataset { x i } i = 1 N {\displaystyle \{x_{i}\}_{i=1}^{N}} of samples each independently drawn from the target distribution p ∗ ( x ) {\displaystyle p^{*}(x)} , then this term can be estimated as:
− E ^ p ∗ ( x ) [ log p θ ( x ) ] = − 1 N ∑ i = 0 N log p θ ( x i ) {\displaystyle -{\hat {\mathop {\mathbb {E} } }}_{p^{*}(x)}[\log p_{\theta }(x)]=-{\frac {1}{N}}\sum _{i=0}^{N}\log p_{\theta }(x_{i})}Therefore, the learning objective
a r g m i n θ D KL [ p ∗ ( x ) ‖ p θ ( x ) ] {\displaystyle {\underset {\theta }{\operatorname {arg\,min} }}\ D_{\text{KL}}[p^{*}(x)\|p_{\theta }(x)]}is replaced by
a r g m a x θ ∑ i = 0 N log p θ ( x i ) {\displaystyle {\underset {\theta }{\operatorname {arg\,max} }}\ \sum _{i=0}^{N}\log p_{\theta }(x_{i})}In other words, minimizing the Kullback–Leibler divergence between the model's likelihood and the target distribution is equivalent to maximizing the model likelihood under observed samples of the target distribution.7
A pseudocode for training normalizing flows is as follows:8
- INPUT. dataset x 1 : n {\displaystyle x_{1:n}} , normalizing flow model f θ ( ⋅ ) , p 0 {\displaystyle f_{\theta }(\cdot ),p_{0}} .
- SOLVE. max θ ∑ j ln p θ ( x j ) {\displaystyle \max _{\theta }\sum _{j}\ln p_{\theta }(x_{j})} by gradient descent
- RETURN. θ ^ {\displaystyle {\hat {\theta }}}
Variants
Planar Flow
The earliest example.9 Fix some activation function h {\displaystyle h} , and let θ = ( u , w , b ) {\displaystyle \theta =(u,w,b)} with the appropriate dimensions, then x = f θ ( z ) = z + u h ( ⟨ w , z ⟩ + b ) {\displaystyle x=f_{\theta }(z)=z+uh(\langle w,z\rangle +b)} The inverse f θ − 1 {\displaystyle f_{\theta }^{-1}} has no closed-form solution in general.
The Jacobian is | det ( I + h ′ ( ⟨ w , z ⟩ + b ) u w T ) | = | 1 + h ′ ( ⟨ w , z ⟩ + b ) ⟨ u , w ⟩ | {\displaystyle |\det(I+h'(\langle w,z\rangle +b)uw^{T})|=|1+h'(\langle w,z\rangle +b)\langle u,w\rangle |} .
For it to be invertible everywhere, it must be nonzero everywhere. For example, h = tanh {\displaystyle h=\tanh } and ⟨ u , w ⟩ > − 1 {\displaystyle \langle u,w\rangle >-1} satisfies the requirement.
Nonlinear Independent Components Estimation (NICE)
Let x , z ∈ R 2 n {\displaystyle x,z\in \mathbb {R} ^{2n}} be even-dimensional, and split them in the middle.10 Then the normalizing flow functions are x = [ x 1 x 2 ] = f θ ( z ) = [ z 1 z 2 ] + [ 0 m θ ( z 1 ) ] {\displaystyle x={\begin{bmatrix}x_{1}\\x_{2}\end{bmatrix}}=f_{\theta }(z)={\begin{bmatrix}z_{1}\\z_{2}\end{bmatrix}}+{\begin{bmatrix}0\\m_{\theta }(z_{1})\end{bmatrix}}} where m θ {\displaystyle m_{\theta }} is any neural network with weights θ {\displaystyle \theta } .
f θ − 1 {\displaystyle f_{\theta }^{-1}} is just z 1 = x 1 , z 2 = x 2 − m θ ( x 1 ) {\displaystyle z_{1}=x_{1},z_{2}=x_{2}-m_{\theta }(x_{1})} , and the Jacobian is just 1, that is, the flow is volume-preserving.
When n = 1 {\displaystyle n=1} , this is seen as a curvy shearing along the x 2 {\displaystyle x_{2}} direction.
Real Non-Volume Preserving (Real NVP)
The Real Non-Volume Preserving model generalizes NICE model by:11 x = [ x 1 x 2 ] = f θ ( z ) = [ z 1 e s θ ( z 1 ) ⊙ z 2 ] + [ 0 m θ ( z 1 ) ] {\displaystyle x={\begin{bmatrix}x_{1}\\x_{2}\end{bmatrix}}=f_{\theta }(z)={\begin{bmatrix}z_{1}\\e^{s_{\theta }(z_{1})}\odot z_{2}\end{bmatrix}}+{\begin{bmatrix}0\\m_{\theta }(z_{1})\end{bmatrix}}}
Its inverse is z 1 = x 1 , z 2 = e − s θ ( x 1 ) ⊙ ( x 2 − m θ ( x 1 ) ) {\displaystyle z_{1}=x_{1},z_{2}=e^{-s_{\theta }(x_{1})}\odot (x_{2}-m_{\theta }(x_{1}))} , and its Jacobian is ∏ i = 1 n e s θ ( z 1 , ) {\displaystyle \prod _{i=1}^{n}e^{s_{\theta }(z_{1,})}} . The NICE model is recovered by setting s θ = 0 {\displaystyle s_{\theta }=0} . Since the Real NVP map keeps the first and second halves of the vector x {\displaystyle x} separate, it's usually required to add a permutation ( x 1 , x 2 ) ↦ ( x 2 , x 1 ) {\displaystyle (x_{1},x_{2})\mapsto (x_{2},x_{1})} after every Real NVP layer.
Generative Flow (Glow)
In generative flow model,12 each layer has 3 parts:
- channel-wise affine transform y c i j = s c ( x c i j + b c ) {\displaystyle y_{cij}=s_{c}(x_{cij}+b_{c})} with Jacobian ∏ c s c H W {\displaystyle \prod _{c}s_{c}^{HW}} .
- invertible 1x1 convolution z c i j = ∑ c ′ K c c ′ y c i j {\displaystyle z_{cij}=\sum _{c'}K_{cc'}y_{cij}} with Jacobian det ( K ) H W {\displaystyle \det(K)^{HW}} . Here K {\displaystyle K} is any invertible matrix.
- Real NVP, with Jacobian as described in Real NVP.
The idea of using the invertible 1x1 convolution is to permute all layers in general, instead of merely permuting the first and second half, as in Real NVP.
Masked Autoregressive Flow (MAF)
An autoregressive model of a distribution on R n {\displaystyle \mathbb {R} ^{n}} is defined as the following stochastic process:13
x 1 ∼ N ( μ 1 , σ 1 2 ) x 2 ∼ N ( μ 2 ( x 1 ) , σ 2 ( x 1 ) 2 ) ⋯ x n ∼ N ( μ n ( x 1 : n − 1 ) , σ n ( x 1 : n − 1 ) 2 ) {\displaystyle {\begin{aligned}x_{1}\sim &N(\mu _{1},\sigma _{1}^{2})\\x_{2}\sim &N(\mu _{2}(x_{1}),\sigma _{2}(x_{1})^{2})\\&\cdots \\x_{n}\sim &N(\mu _{n}(x_{1:n-1}),\sigma _{n}(x_{1:n-1})^{2})\\\end{aligned}}} where μ i : R i − 1 → R {\displaystyle \mu _{i}:\mathbb {R} ^{i-1}\to \mathbb {R} } and σ i : R i − 1 → ( 0 , ∞ ) {\displaystyle \sigma _{i}:\mathbb {R} ^{i-1}\to (0,\infty )} are fixed functions that define the autoregressive model.
By the reparameterization trick, the autoregressive model is generalized to a normalizing flow: x 1 = μ 1 + σ 1 z 1 x 2 = μ 2 ( x 1 ) + σ 2 ( x 1 ) z 2 ⋯ x n = μ n ( x 1 : n − 1 ) + σ n ( x 1 : n − 1 ) z n {\displaystyle {\begin{aligned}x_{1}=&\mu _{1}+\sigma _{1}z_{1}\\x_{2}=&\mu _{2}(x_{1})+\sigma _{2}(x_{1})z_{2}\\&\cdots \\x_{n}=&\mu _{n}(x_{1:n-1})+\sigma _{n}(x_{1:n-1})z_{n}\\\end{aligned}}} The autoregressive model is recovered by setting z ∼ N ( 0 , I n ) {\displaystyle z\sim N(0,I_{n})} .
The forward mapping is slow (because it's sequential), but the backward mapping is fast (because it's parallel).
The Jacobian matrix is lower-diagonal, so the Jacobian is σ 1 σ 2 ( x 1 ) ⋯ σ n ( x 1 : n − 1 ) {\displaystyle \sigma _{1}\sigma _{2}(x_{1})\cdots \sigma _{n}(x_{1:n-1})} .
Reversing the two maps f θ {\displaystyle f_{\theta }} and f θ − 1 {\displaystyle f_{\theta }^{-1}} of MAF results in Inverse Autoregressive Flow (IAF), which has fast forward mapping and slow backward mapping.14
Continuous Normalizing Flow (CNF)
Instead of constructing flow by function composition, another approach is to formulate the flow as a continuous-time dynamic.1516 Let z 0 {\displaystyle z_{0}} be the latent variable with distribution p ( z 0 ) {\displaystyle p(z_{0})} . Map this latent variable to data space with the following flow function:
x = F ( z 0 ) = z T = z 0 + ∫ 0 T f ( z t , t ) d t {\displaystyle x=F(z_{0})=z_{T}=z_{0}+\int _{0}^{T}f(z_{t},t)dt}where f {\displaystyle f} is an arbitrary function and can be modeled with e.g. neural networks.
The inverse function is then naturally:17
z 0 = F − 1 ( x ) = z T + ∫ T 0 f ( z t , t ) d t = z T − ∫ 0 T f ( z t , t ) d t {\displaystyle z_{0}=F^{-1}(x)=z_{T}+\int _{T}^{0}f(z_{t},t)dt=z_{T}-\int _{0}^{T}f(z_{t},t)dt}And the log-likelihood of x {\displaystyle x} can be found as:18
log ( p ( x ) ) = log ( p ( z 0 ) ) − ∫ 0 T Tr [ ∂ f ∂ z t ] d t {\displaystyle \log(p(x))=\log(p(z_{0}))-\int _{0}^{T}{\text{Tr}}\left[{\frac {\partial f}{\partial z_{t}}}\right]dt}Since the trace depends only on the diagonal of the Jacobian ∂ z t f {\displaystyle \partial _{z_{t}}f} , this allows "free-form" Jacobian.19 Here, "free-form" means that there is no restriction on the Jacobian's form. It is contrasted with previous discrete models of normalizing flow, where the Jacobian is carefully designed to be only upper- or lower-diagonal, so that the Jacobian can be evaluated efficiently.
The trace can be estimated by "Hutchinson's trick":2021
Given any matrix W ∈ R n × n {\displaystyle W\in \mathbb {R} ^{n\times n}} , and any random u ∈ R n {\displaystyle u\in \mathbb {R} ^{n}} with E [ u u T ] = I {\displaystyle E[uu^{T}]=I} , we have E [ u T W u ] = t r ( W ) {\displaystyle E[u^{T}Wu]=tr(W)} . (Proof: expand the expectation directly.)
Usually, the random vector is sampled from N ( 0 , I ) {\displaystyle N(0,I)} (normal distribution) or { ± n − 1 / 2 } n {\displaystyle \{\pm n^{-1/2}\}^{n}} (Radamacher distribution).
When f {\displaystyle f} is implemented as a neural network, neural ODE methods22 would be needed. Indeed, CNF was first proposed in the same paper that proposed neural ODE.
There are two main deficiencies of CNF, one is that a continuous flow must be a homeomorphism, thus preserve orientation and ambient isotopy (for example, it's impossible to flip a left-hand to a right-hand by continuous deforming of space, and it's impossible to turn a sphere inside out, or undo a knot), and the other is that the learned flow f {\displaystyle f} might be ill-behaved, due to degeneracy (that is, there are an infinite number of possible f {\displaystyle f} that all solve the same problem).
By adding extra dimensions, the CNF gains enough freedom to reverse orientation and go beyond ambient isotopy (just like how one can pick up a polygon from a desk and flip it around in 3-space, or unknot a knot in 4-space), yielding the "augmented neural ODE".23
Any homeomorphism of R n {\displaystyle \mathbb {R} ^{n}} can be approximated by a neural ODE operating on R 2 n + 1 {\displaystyle \mathbb {R} ^{2n+1}} , proved by combining Whitney embedding theorem for manifolds and the universal approximation theorem for neural networks.24
To regularize the flow f {\displaystyle f} , one can impose regularization losses. The paper 25 proposed the following regularization loss based on optimal transport theory: λ K ∫ 0 T ‖ f ( z t , t ) ‖ 2 d t + λ J ∫ 0 T ‖ ∇ z f ( z t , t ) ‖ F 2 d t {\displaystyle \lambda _{K}\int _{0}^{T}\left\|f(z_{t},t)\right\|^{2}dt+\lambda _{J}\int _{0}^{T}\left\|\nabla _{z}f(z_{t},t)\right\|_{F}^{2}dt} where λ K , λ J > 0 {\displaystyle \lambda _{K},\lambda _{J}>0} are hyperparameters. The first term punishes the model for oscillating the flow field over time, and the second term punishes it for oscillating the flow field over space. Both terms together guide the model into a flow that is smooth (not "bumpy") over space and time.
Flows on manifolds
When a probabilistic flow transforms a distribution on an m {\displaystyle m} -dimensional smooth manifold embedded in R n {\displaystyle \mathbb {R} ^{n}} , where m < n {\displaystyle m<n} , and where the transformation is specified as a function, R n → R n {\displaystyle \mathbb {R} ^{n}\to \mathbb {R} ^{n}} , the scaling factor between the source and transformed PDFs is not given by the naive computation of the determinant of the n -by- n {\displaystyle n{\text{-by-}}n} Jacobian (which is zero), but instead by the determinant(s) of one or more suitably defined m -by- m {\displaystyle m{\text{-by-}}m} matrices. This section is an interpretation of the tutorial in the appendix of Sorrenson et al.(2023),26 where the more general case of non-isometrically embedded Riemann manifolds is also treated. Here we restrict attention to isometrically embedded manifolds.
As running examples of manifolds with smooth, isometric embedding in R n {\displaystyle \mathbb {R} ^{n}} we shall use:
- The unit hypersphere: S n − 1 = { x ∈ R n : x ′ x = 1 } {\displaystyle \mathbb {S} ^{n-1}=\{\mathbf {x} \in \mathbb {R} ^{n}:\mathbf {x} '\mathbf {x} =1\}} , where flows can be used to generalize e.g. Von Mises-Fisher or uniform spherical distributions.
- The simplex interior: Δ n − 1 = { p = ( p 1 , … , p n ) ∈ R n : p i > 0 , ∑ i p i = 1 } {\displaystyle \Delta ^{n-1}=\{\mathbf {p} =(p_{1},\dots ,p_{n})\in \mathbb {R} ^{n}:p_{i}>0,\sum _{i}p_{i}=1\}} , where n {\displaystyle n} -way categorical distributions live; and where flows can be used to generalize e.g. Dirichlet, or uniform simplex distributions.
As a first example of a spherical manifold flow transform, consider the normalized linear transform, which radially projects onto the unitsphere the output of an invertible linear transform, parametrized by the n -by- n {\displaystyle n{\text{-by-}}n} invertible matrix M {\displaystyle \mathbf {M} } :
f lin ( x ; M ) = M x ‖ M x ‖ {\displaystyle f_{\text{lin}}(\mathbf {x} ;\mathbf {M} )={\frac {\mathbf {Mx} }{\lVert \mathbf {Mx} \rVert }}}In full Euclidean space, f lin : R n → R n {\displaystyle f_{\text{lin}}:\mathbb {R} ^{n}\to \mathbb {R} ^{n}} is not invertible, but if we restrict the domain and co-domain to the unitsphere, then f lin : S n − 1 → S n − 1 {\displaystyle f_{\text{lin}}:\mathbb {S} ^{n-1}\to \mathbb {S} ^{n-1}} is invertible (more specifically it is a bijection and a homeomorphism and a diffeomorphism), with inverse f lin ( ⋅ ; M − 1 ) {\displaystyle f_{\text{lin}}(\cdot \,;\mathbf {M} ^{-1})} . The Jacobian of f lin : R n → R n {\displaystyle f_{\text{lin}}:\mathbb {R} ^{n}\to \mathbb {R} ^{n}} , at y = f lin ( x ; M ) {\displaystyle \mathbf {y} =f_{\text{lin}}(\mathbf {x} ;\mathbf {M} )} is ‖ M x ‖ − 1 ( I n − y y ′ ) M {\displaystyle \lVert \mathbf {Mx} \rVert ^{-1}(\mathbf {I} _{n}-\mathbf {yy} ')\mathbf {M} } , which has rank n − 1 {\displaystyle n-1} and determinant of zero; while as explained here, the factor (see subsection below) relating source and transformed densities is: ‖ M x ‖ − n | det M | {\displaystyle \lVert \mathbf {Mx} \rVert ^{-n}\left|\operatorname {det} \mathbf {M} \right|} .
Differential volume ratio
For m < n {\displaystyle m<n} , let M ⊂ R n {\displaystyle {\mathcal {M}}\subset \mathbb {R} ^{n}} be an m {\displaystyle m} -dimensional manifold with a smooth, isometric embedding into R n {\displaystyle \mathbb {R} ^{n}} . Let f : R n → R n {\displaystyle f:\mathbb {R} ^{n}\to \mathbb {R} ^{n}} be a smooth flow transform with range restricted to M {\displaystyle {\mathcal {M}}} . Let x ∈ M {\displaystyle \mathbf {x} \in {\mathcal {M}}} be sampled from a distribution with density P X {\displaystyle P_{X}} . Let y = f ( x ) {\displaystyle \mathbf {y} =f(\mathbf {x} )} , with resultant (pushforward) density P Y {\displaystyle P_{Y}} . Let U ⊂ M {\displaystyle U\subset {\mathcal {M}}} be a small, convex region containing x {\displaystyle \mathbf {x} } and let V = f ( U ) {\displaystyle V=f(U)} be its image, which contains y {\displaystyle \mathbf {y} } ; then by conservation of probability mass:
P X ( x ) volume ( U ) ≈ P Y ( y ) volume ( V ) {\displaystyle P_{X}(\mathbf {x} )\operatorname {volume} (U)\approx P_{Y}(\mathbf {y} )\operatorname {volume} (V)}where volume (for very small regions) is given by Lebesgue measure in m {\displaystyle m} -dimensional tangent space. By making the regions infinitessimally small, the factor relating the two densities is the ratio of volumes, which we term the differential volume ratio.
To obtain concrete formulas for volume on the m {\displaystyle m} -dimensional manifold, we contruct U {\displaystyle U} by mapping an m {\displaystyle m} -dimensional rectangle in (local) coordinate space to the manifold via a smooth embedding function: R m → R n {\displaystyle \mathbb {R} ^{m}\to \mathbb {R} ^{n}} . At very small scale, the embedding function becomes essentially linear so that U {\displaystyle U} is a parallelotope (multidimensional generalization of a parallelogram). Similarly, the flow transform, f {\displaystyle f} becomes linear, so that the image, V = f ( U ) {\displaystyle V=f(U)} is also a parallelotope. In R m {\displaystyle \mathbb {R} ^{m}} , we can represent an m {\displaystyle m} -dimensional parallelotope with an m -by- m {\displaystyle m{\text{-by-}}m} matrix whose colum-vectors are a set of edges (meeting at a common vertex) that span the paralellotope. The volume is given by the absolute value of the determinant of this matrix. If more generally (as is the case here), an m {\displaystyle m} -dimensional paralellotope is embedded in R n {\displaystyle \mathbb {R} ^{n}} , it can be represented with a (tall) n -by- m {\displaystyle n{\text{-by-}}m} matrix, say V {\displaystyle \mathbf {V} } . Denoting the parallelotope as / V / {\displaystyle /\mathbf {V} \!/} , its volume is then given by the square root of the Gram determinant:
volume / V / = | det ( V ′ V ) | {\displaystyle \operatorname {volume} /\mathbf {V} \!/={\sqrt {\left|\operatorname {det} (\mathbf {V} '\mathbf {V} )\right|}}}In the sections below, we show various ways to use this volume formula to derive the differential volume ratio.
Simplex flow
As a first example, we develop expressions for the differential volume ratio of a simplex flow, q = f ( p ) {\displaystyle \mathbf {q} =f(\mathbf {p} )} , where p , q ∈ M = Δ n − 1 {\displaystyle \mathbf {p} ,\mathbf {q} \in {\mathcal {M}}=\Delta ^{n-1}} . Define the embedding function:
e : p ~ = ( p 1 … , p n − 1 ) ↦ p = ( p 1 … , p n − 1 , 1 − ∑ i = 1 n − 1 p i ) {\displaystyle e:{\tilde {\mathbf {p} }}=(p_{1}\dots ,p_{n-1})\mapsto \mathbf {p} =(p_{1}\dots ,p_{n-1},1-\sum _{i=1}^{n-1}p_{i})}which maps a conveniently chosen, ( n − 1 ) {\displaystyle (n-1)} -dimensional repesentation, p ~ {\displaystyle {\tilde {\mathbf {p} }}} , to the embedded manifold. The n -by- ( n − 1 ) {\displaystyle n{\text{-by-}}(n-1)} Jacobian is E = [ I n − 1 − 1 ′ ] {\displaystyle \mathbf {E} ={\begin{bmatrix}\mathbf {I} _{n-1}\\-{\boldsymbol {1}}'\end{bmatrix}}} . To define U {\displaystyle U} , the differential volume element at the transformation input ( p ∈ Δ n − 1 {\displaystyle \mathbf {p} \in \Delta ^{n-1}} ), we start with a rectangle in p ~ {\displaystyle {\tilde {\mathbf {p} }}} -space, having (signed) differential side-lengths, d p 1 , … , d p n − 1 {\displaystyle dp_{1},\dots ,dp_{n-1}} from which we form the square diagonal matrix D {\displaystyle \mathbf {D} } , the columns of which span the rectangle. At very small scale, we get U = e ( D ) = / E D / {\displaystyle U=e(\mathbf {D} )=/\mathbf {ED} \!/} , with:
volume ( U ) = | det ( D E ′ E D ) | = | det ( E ′ E ) | | det D ) | = n ∏ i = 1 n − 1 | d p i | {\displaystyle \operatorname {volume} (U)={\sqrt {\left|\operatorname {det} (\mathbf {DE} '\mathbf {ED} )\right|}}={\sqrt {\left|\operatorname {det} (\mathbf {E} '\mathbf {E} )\right|}}\,\left|\operatorname {det} \mathbf {D} )\right|={\sqrt {n}}\prod _{i=1}^{n-1}\left|dp_{i}\right|}To understand the geometric interpretation of the factor n {\displaystyle {\sqrt {n}}} , see the example for the 1-simplex in the diagram at right.
The differential volume element at the transformation output ( q ∈ Δ n − 1 {\displaystyle \mathbf {q} \in \Delta ^{n-1}} ), is the parallelotope, V = f ( U ) = / F p E D / {\displaystyle V=f(U)=/\mathbf {F_{p}ED} \!/} , where F p {\displaystyle \mathbf {F_{p}} } is the n -by- n {\displaystyle n{\text{-by-}}n} Jacobian of f {\displaystyle f} at p = e ( p ~ ) {\displaystyle \mathbf {p} =e({\tilde {\mathbf {p} }})} . Its volume is:
volume ( V ) = | det ( D E ′ F p ′ F p E D ) | = | det ( E ′ F p ′ F p E ) | | det D ) | {\displaystyle \operatorname {volume} (V)={\sqrt {\left|\operatorname {det} (\mathbf {DE} '\mathbf {F_{p}} '\mathbf {F_{p}ED} )\right|}}={\sqrt {\left|\operatorname {det} (\mathbf {E} '\mathbf {F_{p}} '\mathbf {F_{p}E} )\right|}}\,\left|\operatorname {det} \mathbf {D} )\right|}so that the factor | det D ) | {\displaystyle \left|\operatorname {det} \mathbf {D} )\right|} cancels in the volume ratio, which can now already be numerically evaluated. It can however be rewritten in a sometimes more convenient form by also introducing the representation function, r : p ↦ p ~ {\displaystyle r:\mathbf {p} \mapsto {\tilde {\mathbf {p} }}} , which simply extracts the first ( n − 1 ) {\displaystyle (n-1)} components. The Jacobian is R = [ I n 0 ] {\displaystyle \mathbf {R} ={\begin{bmatrix}\mathbf {I} _{n}&{\boldsymbol {0}}\end{bmatrix}}} . Observe that, since e ∘ r ∘ f = f {\displaystyle e\circ r\circ f=f} , the chain rule for function composition gives: E R F p = F p {\displaystyle \mathbf {ERF_{p}} =\mathbf {F_{p}} } . By plugging this expansion into the above Gram determinant and then refactoring it as a product of determinants of square matrices, we can extract the factor | det ( E ′ E ) | = n {\displaystyle {\sqrt {\left|\operatorname {det} (\mathbf {E} '\mathbf {E} )\right|}}={\sqrt {n}}} , which now also cancels in the ratio, which finally simpifies to the determinant of the Jacobian of the "sandwiched" flow transformation, r ∘ f ∘ e {\displaystyle r\circ f\circ e} :
R f Δ ( p ) = volume ( V ) volume ( U ) = | det ( R F p E ) | {\displaystyle R_{f}^{\Delta }(\mathbf {p} )={\frac {\operatorname {volume} (V)}{\operatorname {volume} (U)}}=\left|\operatorname {det} (\mathbf {RF_{p}E} )\right|}which, if p ∼ P P {\displaystyle \mathbf {p} \sim P_{\mathbf {P} }} , can be used to derive the pushforward density after a change of variables, q = f ( p ) {\displaystyle \mathbf {q} =f(\mathbf {p} )} :
P Q ( q ) = P P ( p ) R f Δ ( p ) , where p = f − 1 ( q ) {\displaystyle P_{\mathbf {Q} }(\mathbf {q} )={\frac {P_{\mathbf {P} }(\mathbf {p} )}{R_{f}^{\Delta }(\mathbf {p} )}}\,,\;{\text{where}}\;\;\mathbf {p} =f^{-1}(\mathbf {q} )}This formula is valid only because the simplex is flat and the Jacobian, E {\displaystyle \mathbf {E} } is constant. The more general case for curved manifolds is discussed below, after we present two concrete examples of simplex flow transforms.
Simplex calibration transform
A calibration transform, f cal : Δ n − 1 → Δ n − 1 {\displaystyle f_{\text{cal}}:\Delta ^{n-1}\to \Delta ^{n-1}} , which is sometimes used in machine learning for post-processing of the (class posterior) outputs of a probabilistic n {\displaystyle n} -class classifier,2728 uses the softmax function to renormalize categorical distributions after scaling and translation of the input distributions in log-probability space. For p , q ∈ Δ n − 1 {\displaystyle \mathbf {p} ,\mathbf {q} \in \Delta ^{n-1}} and with parameters, a > 0 {\displaystyle a>0} and c ∈ R n {\displaystyle \mathbf {c} \in \mathbb {R} ^{n}} the transform can be specified as:
q = f cal ( p ; a , c ) = softmax ( a − 1 log p + c ) ⟺ p = f cal − 1 ( q ; a , c ) = softmax ( a log q − a c ) {\displaystyle \mathbf {q} =f_{\text{cal}}(\mathbf {p} ;a,\mathbf {c} )=\operatorname {softmax} (a^{-1}\log \mathbf {p} +\mathbf {c} )\;\iff \;\mathbf {p} =f_{\text{cal}}^{-1}(\mathbf {q} ;a,\mathbf {c} )=\operatorname {softmax} (a\log \mathbf {q} -a\mathbf {c} )}where the log is applied elementwise. After some algebra the differential volume ratio can be expressed as:
R cal Δ ( p ; a , c ) = | det ( R F p E ) | = a 1 − n ∏ i = 1 n q i p i {\displaystyle R_{\text{cal}}^{\Delta }(\mathbf {p} ;a,\mathbf {c} )=\left|\operatorname {det} (\mathbf {RF_{p}E} )\right|=a^{1-n}\prod _{i=1}^{n}{\frac {q_{i}}{p_{i}}}}- This result can also be obtained by factoring the density of the SGB distribution,29 which is obtained by sending Dirichlet variates through f cal {\displaystyle f_{\text{cal}}} .
While calibration transforms are most often trained as discriminative models, the reinterpretation here as a probabilistic flow allows also the design of generative calibration models based on this transform.
Generalized calibration transform
The above calibration transform can be generalized to f gcal : Δ n − 1 → Δ n − 1 {\displaystyle f_{\text{gcal}}:\Delta ^{n-1}\to \Delta ^{n-1}} , with parameters c ∈ R n {\displaystyle \mathbf {c} \in \mathbb {R} ^{n}} and A {\displaystyle \mathbf {A} } n -by- n {\displaystyle n{\text{-by-}}n} invertible:30
q = f gcal ( p ; A , c ) = softmax ( A log p + c ) , subject to A 1 = λ 1 {\displaystyle \mathbf {q} =f_{\text{gcal}}(\mathbf {p} ;\mathbf {A} ,\mathbf {c} )=\operatorname {softmax} (\mathbf {A} \log \mathbf {p} +\mathbf {c} )\,,\;{\text{subject to}}\;\mathbf {A1} =\lambda \mathbf {1} }where the condition that A {\displaystyle \mathbf {A} } has 1 {\displaystyle \mathbf {1} } as an eigenvector ensures invertibility by sidestepping the information loss due to the invariance: softmax ( x + α 1 ) = softmax ( x ) {\displaystyle \operatorname {softmax} (\mathbf {x} +\alpha \mathbf {1} )=\operatorname {softmax} (\mathbf {x} )} . Note in particular that A = λ I n {\displaystyle \mathbf {A} =\lambda \mathbf {I} _{n}} is the only allowed diagonal parametrization, in which case (for λ > 0 {\displaystyle \lambda >0} ) we recover f cal ( p ; λ − 1 , c ) {\displaystyle f_{\text{cal}}(\mathbf {p} ;\lambda ^{-1},\mathbf {c} )} , while (for n > 2 {\displaystyle n>2} ) generalization is possible with non-diagonal matrices. The inverse is:
p = f gcal − 1 ( q ; A , c ) = f gcal ( q ; A − 1 , − A − 1 c ) , where A 1 = λ 1 ⟹ A − 1 1 = λ − 1 1 {\displaystyle \mathbf {p} =f_{\text{gcal}}^{-1}(\mathbf {q} ;\mathbf {A} ,\mathbf {c} )=f_{\text{gcal}}(\mathbf {q} ;\mathbf {A} ^{-1},-\mathbf {A} ^{-1}\mathbf {c} )\,,\;{\text{where}}\;\mathbf {A1} =\lambda \mathbf {1} \Longrightarrow \mathbf {A} ^{-1}\mathbf {1} =\lambda ^{-1}\mathbf {1} }The differential volume ratio is:
R gcal Δ ( p ; A , c ) = | det ( A ) | | λ | ∏ i = 1 n q i p i {\displaystyle R_{\text{gcal}}^{\Delta }(\mathbf {p} ;\mathbf {A} ,\mathbf {c} )={\frac {\left|\operatorname {det} (\mathbf {A} )\right|}{|\lambda |}}\prod _{i=1}^{n}{\frac {q_{i}}{p_{i}}}}If f gcal {\displaystyle f_{\text{gcal}}} is to be used as a calibration transform, a further constraint could be imposed that A {\displaystyle \mathbf {A} } be positive definite, so that ( A x ) ′ x > 0 {\displaystyle (\mathbf {Ax} )'\mathbf {x} >0} , which avoids direction reversals. (This condition is the generalization of a > 0 {\displaystyle a>0} in the f cal {\displaystyle f_{\text{cal}}} parameter.)
If n = 2 {\displaystyle n=2} , a > 0 {\displaystyle a>0} and A {\displaystyle \mathbf {A} } positive definite, then f cal {\displaystyle f_{\text{cal}}} and f gcal {\displaystyle f_{\text{gcal}}} are equivalent in the sense that in both cases, log p 1 p 2 ↦ log q 1 q 2 {\displaystyle \log {\frac {p_{1}}{p_{2}}}\mapsto \log {\frac {q_{1}}{q_{2}}}} is a straight line, the (positive) slope and offset of which are functions of the transform parameters.
Differential volume ratio for curved manifolds
Consider a flow, y = f ( x ) {\displaystyle \mathbf {y} =f(\mathbf {x} )} on a curved manifold, for example S n − 1 {\displaystyle \mathbb {S} ^{n-1}} which we equip with the embedding function, e {\displaystyle e} that maps a set of ( n − 1 ) {\displaystyle (n-1)} angular spherical coordinates to S n − 1 {\displaystyle \mathbb {S} ^{n-1}} . The Jacobian of e {\displaystyle e} is non-constant and we have to evaluate it at both input ( E x {\displaystyle \mathbf {E_{x}} } ) and output ( E y {\displaystyle \mathbf {E_{y}} } ). The same applies to r {\displaystyle r} , the represententation function that recovers spherical coordinates from points on S n − 1 {\displaystyle \mathbb {S} ^{n-1}} , for which we need the Jacobian at the output ( R y {\displaystyle \mathbf {R_{y}} } ). The differential volume ratio now generalizes to:
R f ( x ) = | det ( R y F x E x ) | | det ( E y ′ E y ) | | det ( E x ′ E x ) | {\displaystyle R_{f}(\mathbf {x} )=\left|\operatorname {det} (\mathbf {R_{y}F_{x}E_{x}} )\right|\,{\frac {\sqrt {\left|\operatorname {det} (\mathbf {E} _{\mathbf {y} }'\mathbf {E_{y}} )\right|}}{\sqrt {\left|\operatorname {det} (\mathbf {E} _{\mathbf {x} }'\mathbf {E_{x}} )\right|}}}}For geometric insight, consider S 2 {\displaystyle \mathbf {S} ^{2}} , where the spherical coordinates are co-latitude, θ ∈ [ 0 , π ] {\displaystyle \theta \in [0,\pi ]} and longitude, ϕ ∈ [ 0 , 2 π ) {\displaystyle \phi \in [0,2\pi )} . At x = e ( θ , ϕ ) {\displaystyle \mathbf {x} =e(\theta ,\phi )} , we get | det ( E x ′ E x ) | = sin θ {\displaystyle {\sqrt {\left|\operatorname {det} (\mathbf {E} _{\mathbf {x} }'\mathbf {E_{x}} )\right|}}=\sin \theta } , which gives the radius of the circle at that latitude (compare e.g. polar circle to equator). The differential volume (surface area on the sphere) is: sin θ d θ d ϕ {\displaystyle \sin \theta \,d\theta \,d\phi } .
The above derivation for R f {\displaystyle R_{f}} is fragile in the sense that when using fixed functions e , r {\displaystyle e,r} , there may be places where they are not well-defined, for example at the poles of the 2-sphere where longitude is arbitrary. This problem is sidestepped (using standard manifold machinery) by generalizing to local coordinates (charts), where in the vicinities of x , y ∈ M {\displaystyle \mathbf {x} ,\mathbf {y} \in {\mathcal {M}}} , we map from local m {\displaystyle m} -dimensional coordinates to R n {\displaystyle \mathbb {R} ^{n}} and back using the respective function pairs e x , r x {\displaystyle e_{\mathbf {x} },r_{\mathbf {x} }} and e y , r y {\displaystyle e_{\mathbf {y} },r_{\mathbf {y} }} . We continue to use the same notation for the Jacobians of these functions ( E x , E y , R y {\displaystyle \mathbf {E_{x}} ,\mathbf {E_{y}} ,\mathbf {R_{y}} } ), so that the above formula for R f {\displaystyle R_{f}} remains valid.
We can however, choose our local coordinate system in a way that simplifies the expression for R f {\displaystyle R_{f}} and indeed also its practical implementation.31 Let π : P → R n {\displaystyle \pi :{\mathcal {P}}\to \mathbb {R} ^{n}} be a smooth idempotent projection ( π ∘ π = π {\displaystyle \pi \circ \pi =\pi } ) from the projectible set, P ⊆ R n {\displaystyle {\mathcal {P}}\subseteq \mathbb {R} ^{n}} , onto the embedded manifold. For example:
- The positive orthant of R n {\displaystyle \mathbb {R} ^{n}} is projected onto the simplex as: π ( z ) = ( ∑ i = 1 n z i ) − 1 z {\displaystyle \pi (\mathbf {z} )={\bigl (}\sum _{i=1}^{n}z_{i}{\bigr )}^{-1}\mathbf {z} }
- Non-zero vectors in R n {\displaystyle \mathbb {R} ^{n}} are projected onto the unitsphere as: π ( z ) = ( ∑ i = 1 n z i 2 ) − 1 2 z {\displaystyle \pi (\mathbf {z} )={\bigl (}\sum _{i=1}^{n}z_{i}^{2}{\bigr )}^{-{\frac {1}{2}}}\mathbf {z} }
For every x ∈ M {\displaystyle \mathbf {x} \in {\mathcal {M}}} , we require of π {\displaystyle \pi } that its n -by- n {\displaystyle n{\text{-by-}}n} Jacobian, Π x {\displaystyle {\boldsymbol {\Pi _{x}}}} has rank m {\displaystyle m} (the manifold dimension), in which case Π x {\displaystyle {\boldsymbol {\Pi _{x}}}} is an idempotent projection onto the local tangent space (orthogonal for the unitsphere: I n − x x ′ {\displaystyle \mathbf {I} _{n}-\mathbf {xx} '} ; oblique for the simplex: I n − x 1 ′ {\displaystyle \mathbf {I} _{n}-{\boldsymbol {x1}}'} ). The colums of Π x {\displaystyle {\boldsymbol {\Pi _{x}}}} span the m {\displaystyle m} -dimensional tangent space at x {\displaystyle \mathbf {x} } . We use the notation, T x {\displaystyle \mathbf {T_{x}} } for any n -by- m {\displaystyle n{\text{-by-}}m} matrix with orthonormal columns ( T x ′ T x = I m {\displaystyle \mathbf {T} _{\mathbf {x} }'\mathbf {T_{x}} =\mathbf {I} _{m}} ) that span the local tangent space. Also note: Π x T x = T x {\displaystyle {\boldsymbol {\Pi _{x}}}\mathbf {T_{x}} =\mathbf {T_{x}} } . We can now choose our local coordinate embedding function, e x : R m → R n {\displaystyle e_{\mathbf {x} }:\mathbb {R} ^{m}\to \mathbb {R} ^{n}} :
e x ( x ~ ) = π ( x + T x x ~ ) , with Jacobian: E x = T x {\displaystyle e_{\mathbf {x} }({\tilde {x}})=\pi (\mathbf {x} +\mathbf {T_{x}{\tilde {x}}} )\,,{\text{with Jacobian:}}\,\mathbf {E_{x}} =\mathbf {T_{x}} }since the Jacobian is injective (full rank: m {\displaystyle m} ), a local (not necessarily unique) left inverse, say r x ∗ {\displaystyle r_{\mathbf {x} }^{*}} with Jacobian R x ∗ {\displaystyle \mathbf {R} _{\mathbf {x} }^{*}} , exists such that r x ∗ ( e x ( x ~ ) ) = x ~ {\displaystyle r_{\mathbf {x} }^{*}(e_{\mathbf {x} }({\tilde {x}}))={\tilde {x}}} and R x ∗ T x = I m {\displaystyle \mathbf {R} _{\mathbf {x} }^{*}\mathbf {T_{x}} =\mathbf {I} _{m}} . In practice we do not need the left inverse function itself, but we do need its Jacobian, for which the above equation does not give a unique solution. We can however enforce a unique solution for the Jacobian by choosing the left inverse as, r x : R n → R m {\displaystyle r_{\mathbf {x} }:\mathbb {R} ^{n}\to \mathbb {R} ^{m}} :
r x ( z ) = r x ∗ ( π ( z ) ) , with Jacobian: R x = T x ′ {\displaystyle r_{\mathbf {x} }(\mathbf {z} )=r_{\mathbf {x} }^{*}(\pi (\mathbf {z} ))\,,{\text{with Jacobian:}}\,\mathbf {R_{x}} =\mathbf {T} _{\mathbf {x} }'}We can now finally plug E x = T x {\displaystyle \mathbf {E_{x}} =\mathbf {T_{x}} } and R y = T y ′ {\displaystyle \mathbf {R_{y}} =\mathbf {T} _{\mathbf {y} }'} into our previous expression for R f {\displaystyle R_{f}} , the differential volume ratio, which because of the orthonormal Jacobians, simplifies to:32
R f ( x ) = | det ( T y ′ F x T x ) | {\displaystyle R_{f}(\mathbf {x} )=\left|\operatorname {det} (\mathbf {T_{y}} '\mathbf {F_{x}T_{x}} )\right|}Practical implementation
For learning the parameters of a manifold flow transformation, we need access to the differential volume ratio, R f {\displaystyle R_{f}} , or at least to its gradient w.r.t. the parameters. Moreover, for some inference tasks, we need access to R f {\displaystyle R_{f}} itself. Practical solutions include:
- Sorrenson et al.(2023)33 give a solution for computationally efficient stochastic parameter gradient approximation for log R f . {\displaystyle \log R_{f}.}
- For some hand-designed flow transforms, R f {\displaystyle R_{f}} can be analytically derived in closed form, for example the above-mentioned simplex calibration transforms. Futher examples are given below in the section on simple spherical flows.
- On a software platform equipped with linear algebra and automatic differentiation, R f ( x ) = | det ( T y ′ F x T x ) | {\displaystyle R_{f}(\mathbf {x} )=\left|\operatorname {det} (\mathbf {T_{y}} '\mathbf {F_{x}T_{x}} )\right|} can be automatically evaluated, given access to only x , f , π {\displaystyle \mathbf {x} ,f,\pi } .34 But this is expensive for high-dimensional data, with at least O ( n 3 ) {\displaystyle {\mathcal {O}}(n^{3})} computational costs. Even then, the slow automatic solution can be invaluable as a tool for numerically verifying hand-designed closed-form solutions.
Simple spherical flows
In machine learning literature, various complex spherical flows formed by deep neural network architectures may be found.35 In contrast, this section compiles from statistics literature the details of three very simple spherical flow transforms, with simple closed-form expressions for inverses and differential volume ratios. These flows can be used individually, or chained, to generalize distributions on the unitsphere, S n − 1 {\displaystyle \mathbb {S} ^{n-1}} . All three flows are compositions of an invertible affine transform in R n {\displaystyle \mathbb {R} ^{n}} , followed by radial projection back onto the sphere. The flavours we consider for the affine transform are: pure translation, pure linear and general affine. To make these flows fully functional for learning, inference and sampling, the tasks are:
- To derive the inverse transform, with suitable restrictions on the parameters to ensure invertibility.
- To derive in simple closed form the differential volume ratio, R f {\displaystyle R_{f}} .
An interesting property of these simple spherical flows is that they don't make use of any non-linearities apart from the radial projection. Even the simplest of them, the normalized translation flow, can be chained to form perhaps suprisingly flexible distributions.
Normalized translation flow
The normalized translation flow, f trans : S n − 1 → S n − 1 {\displaystyle f_{\text{trans}}:\mathbb {S} ^{n-1}\to \mathbb {S} ^{n-1}} , with parameter c ∈ R n {\displaystyle \mathbf {c} \in \mathbb {R} ^{n}} , is given by:
y = f trans ( x ; c ) = x + c ‖ x + c ‖ , where ‖ c ‖ < 1 {\displaystyle \mathbf {y} =f_{\text{trans}}(\mathbf {x} ;\mathbf {c} )={\frac {\mathbf {x} +\mathbf {c} }{\lVert \mathbf {x} +\mathbf {c} \rVert }}\,,\;{\text{where}}\;\lVert \mathbf {c} \rVert <1}The inverse function may be derived by considering, for ℓ > 0 {\displaystyle \ell >0} : y = ℓ − 1 ( x + c ) {\displaystyle \mathbf {y} =\ell ^{-1}(\mathbf {x} +\mathbf {c} )} and then using x ′ x = 1 {\displaystyle \mathbf {x} '\mathbf {x} =1} to get a quadratic equation to recover ℓ {\displaystyle \ell } , which gives:
x = f trans − 1 ( y ; c ) = ℓ y − c , where ℓ = y ′ c + ( y ′ c ) 2 + 1 − c ′ c {\displaystyle \mathbf {x} =f_{\text{trans}}^{-1}(\mathbf {y} ;\mathbf {c} )=\ell \mathbf {y} -\mathbf {c} \,,{\text{where}}\;\ell =\mathbf {y} '\mathbf {c} +{\sqrt {(\mathbf {y} '\mathbf {c} )^{2}+1-\mathbf {c} '\mathbf {c} }}}from which we see that we need ‖ c ‖ < 1 {\displaystyle \lVert \mathbf {c} \rVert <1} to keep ℓ {\displaystyle \ell } real and positive for all y ∈ S n − 1 {\displaystyle \mathbf {y} \in \mathbb {S} ^{n-1}} . The differential volume ratio is given (without derivation) by Boulerice & Ducharme(1994) as:36
R trans ( x ; c ) = 1 + x ′ c ‖ x + c ‖ n {\displaystyle R_{\text{trans}}(\mathbf {x} ;\mathbf {c} )={\frac {1+\mathbf {x} '\mathbf {c} }{\lVert \mathbf {x} +\mathbf {c} \rVert ^{n}}}}This can indeed be verified analytically:
- By a laborious manipulation of R f ( x ) = | det ( T y ′ F x T x ) | {\displaystyle R_{f}(\mathbf {x} )=\left|\operatorname {det} (\mathbf {T_{y}} '\mathbf {F_{x}T_{x}} )\right|} .
- By setting M = I n {\displaystyle \mathbf {M} =\mathbf {I} _{n}} in R aff ( x ; M , c ) {\displaystyle R_{\text{aff}}(\mathbf {x} ;\mathbf {M} ,\mathbf {c} )} , which is given below.
Finally, it is worth noting that f trans {\displaystyle f_{\text{trans}}} and f trans − 1 {\displaystyle f_{\text{trans}}^{-1}} do not have the same functional form.
Normalized linear flow
The normalized linear flow, f lin : S n − 1 → S n − 1 {\displaystyle f_{\text{lin}}:\mathbb {S} ^{n-1}\to \mathbb {S} ^{n-1}} , where parameter M {\displaystyle \mathbf {M} } is an invertible n -by- n {\displaystyle n{\text{-by-}}n} matrix, is given by:
y = f lin ( x ; M ) = M x ‖ M x ‖ ⟺ x = f lin − 1 ( y ; M ) = f lin ( y ; M − 1 ) = M − 1 y ‖ M − 1 y ‖ {\displaystyle \mathbf {y} =f_{\text{lin}}(\mathbf {x} ;\mathbf {M} )={\frac {\mathbf {Mx} }{\lVert \mathbf {Mx} \rVert }}\;\iff \;\mathbf {x} =f_{\text{lin}}^{-1}(\mathbf {y} ;\mathbf {M} )=f_{\text{lin}}(\mathbf {y} ;\mathbf {M} ^{-1})={\frac {\mathbf {M^{-1}y} }{\lVert \mathbf {M^{-1}y} \rVert }}}The differential volume ratio is:
R lin ( x ; M ) = | det M | ‖ M x ‖ n {\displaystyle R_{\text{lin}}(\mathbf {x} ;\mathbf {M} )={\frac {\left|\operatorname {det} \mathbf {M} \right|}{\lVert \mathbf {Mx} \rVert ^{n}}}}This result can be derived indirectly via the Angular central Gaussian distribution (ACG),37 which can be obtained via normalized linear transform of either Gaussian, or uniform spherical variates. The first relationship can be used to derive the ACG density by a marginalization integral over the radius; after which the second relationship can be used to factor out the differential volume ratio. For details, see ACG distribution.
Normalized affine flow
The normalized affine flow, f aff : S n − 1 → S n − 1 {\displaystyle f_{\text{aff}}:\mathbb {S} ^{n-1}\to \mathbb {S} ^{n-1}} , with parameters c ∈ R n {\displaystyle \mathbf {c} \in \mathbb {R} ^{n}} and M {\displaystyle \mathbf {M} } , n -by- n {\displaystyle n{\text{-by-}}n} invertible, is given by:
f aff ( x ; M , c ) = M x + c ‖ M x + c ‖ , where ‖ M − 1 c ‖ < 1 {\displaystyle f_{\text{aff}}(\mathbf {x} ;\mathbf {M} ,\mathbf {c} )={\frac {\mathbf {Mx} +\mathbf {c} }{\lVert \mathbf {Mx} +\mathbf {c} \rVert }}\,,\;{\text{where}}\;\lVert \mathbf {M^{-1}c} \rVert <1}The inverse function, derived in a similar way to the normalized translation inverse is:
x = f aff − 1 ( y ; M , c ) = M − 1 ( ℓ y − c ) , where ℓ = y ′ W c + ( y ′ W c ) 2 + y ′ W y ( 1 − c ′ W c ) y ′ W y {\displaystyle \mathbf {x} =f_{\text{aff}}^{-1}(\mathbf {y} ;\mathbf {M} ,\mathbf {c} )=\mathbf {M} ^{-1}(\ell \mathbf {y} -\mathbf {c} )\,,{\text{where}}\;\ell ={\frac {\mathbf {y} '\mathbf {Wc} +{\sqrt {(\mathbf {y} '\mathbf {Wc} )^{2}+\mathbf {y} '\mathbf {Wy} (1-\mathbf {c} '\mathbf {Wc} )}}}{\mathbf {y} '\mathbf {Wy} }}}where W = ( M M ′ ) − 1 {\displaystyle \mathbf {W} =(\mathbf {MM} ')^{-1}} . The differential volume ratio is:
R aff ( x ; M , c ) = R lin ( x ; M + c x ′ ) = | det M | ( 1 + x ′ M − 1 c ) ‖ M x + c ‖ n {\displaystyle R_{\text{aff}}(\mathbf {x} ;\mathbf {M} ,\mathbf {c} )=R_{\text{lin}}(\mathbf {x} ;\mathbf {M} +\mathbf {c} \mathbf {x} ')={\frac {\left|\operatorname {det} \mathbf {M} \right|(1+\mathbf {x} '\mathbf {M^{-1}c} )}{\lVert \mathbf {Mx+c} \rVert ^{n}}}}The final RHS numerator was expanded from det ( M + c x ′ ) {\displaystyle \operatorname {det} (\mathbf {M} +\mathbf {cx} ')} by the matrix determinant lemma. Recalling R f ( x ) = | det ( T y ′ F x T x ) | {\displaystyle R_{f}(\mathbf {x} )=\left|\operatorname {det} (\mathbf {T} _{\mathbf {y} }'\mathbf {F_{x}T_{x}} )\right|} , the equality between R aff {\displaystyle R_{\text{aff}}} and R lin {\displaystyle R_{\text{lin}}} holds because not only:
x ′ x = 1 ⟹ y = f aff ( x ; M , c ) = f lin ( x ; M + c x ′ ) {\displaystyle \mathbf {x} '\mathbf {x} =1\;\Longrightarrow \;\mathbf {y} =f_{\text{aff}}(\mathbf {x} ;\mathbf {M,c} )=f_{\text{lin}}(\mathbf {x} ;\mathbf {M+cx} ')}but also, by orthogonality of x {\displaystyle \mathbf {x} } to the local tangent space:
x ′ T x = 0 ⟹ F x aff T x = F x lin T x {\displaystyle \mathbf {x} '\mathbf {T_{x}} ={\boldsymbol {0}}\;\Longrightarrow \;\mathbf {F} _{\mathbf {x} }^{\text{aff}}\mathbf {T_{x}} =\mathbf {F} _{\mathbf {x} }^{\text{lin}}\mathbf {T_{x}} }where F x lin = ‖ M x + c ‖ − 1 ( I n − y y ′ ) ( M + c x ′ ) {\displaystyle \mathbf {F} _{\mathbf {x} }^{\text{lin}}=\lVert \mathbf {Mx} +\mathbf {c} \rVert ^{-1}(\mathbf {I} _{n}-\mathbf {yy} ')(\mathbf {M+cx} ')} is the Jacobian of f lin {\displaystyle f_{\text{lin}}} differentiated w.r.t. its input, but not also w.r.t. to its parameter.
Downsides
Despite normalizing flows success in estimating high-dimensional densities, some downsides still exist in their designs. First of all, their latent space where input data is projected onto is not a lower-dimensional space and therefore, flow-based models do not allow for compression of data by default and require a lot of computation. However, it is still possible to perform image compression with them.38
Flow-based models are also notorious for failing in estimating the likelihood of out-of-distribution samples (i.e.: samples that were not drawn from the same distribution as the training set).39 Some hypotheses were formulated to explain this phenomenon, among which the typical set hypothesis,40 estimation issues when training models,41 or fundamental issues due to the entropy of the data distributions.42
One of the most interesting properties of normalizing flows is the invertibility of their learned bijective map. This property is given by constraints in the design of the models (cf.: RealNVP, Glow) which guarantee theoretical invertibility. The integrity of the inverse is important in order to ensure the applicability of the change-of-variable theorem, the computation of the Jacobian of the map as well as sampling with the model. However, in practice this invertibility is violated and the inverse map explodes because of numerical imprecision.43
Applications
Flow-based generative models have been applied on a variety of modeling tasks, including:
- Audio generation44
- Image generation45
- Molecular graph generation46
- Point-cloud modeling47
- Video generation48
- Lossy image compression49
- Anomaly detection50
External links
References
Tabak, Esteban G.; Vanden-Eijnden, Eric (2010). "Density estimation by dual ascent of the log-likelihood". Communications in Mathematical Sciences. 8 (1): 217–233. doi:10.4310/CMS.2010.v8.n1.a11. https://projecteuclid.org/journals/communications-in-mathematical-sciences/volume-8/issue-1/Density-estimation-by-dual-ascent-of-the-log-likelihood/cms/1266935020.full ↩
Tabak, Esteban G.; Turner, Cristina V. (2012). "A family of nonparametric density estimation algorithms". Communications on Pure and Applied Mathematics. 66 (2): 145–164. doi:10.1002/cpa.21423. hdl:11336/8930. S2CID 17820269. https://onlinelibrary.wiley.com/doi/abs/10.1002/cpa.21423 ↩
Papamakarios, George; Nalisnick, Eric; Jimenez Rezende, Danilo; Mohamed, Shakir; Bakshminarayanan, Balaji (2021). "Normalizing flows for probabilistic modeling and inference". Journal of Machine Learning Research. 22 (1): 2617–2680. arXiv:1912.02762. https://dl.acm.org/doi/abs/10.5555/3546258.3546315 ↩
Dinh, Laurent; Krueger, David; Bengio, Yoshua (2014). "NICE: Non-linear Independent Components Estimation". arXiv:1410.8516 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Dinh, Laurent; Sohl-Dickstein, Jascha; Bengio, Samy (2016). "Density estimation using Real NVP". arXiv:1605.08803 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Kingma, Diederik P.; Dhariwal, Prafulla (2018). "Glow: Generative Flow with Invertible 1x1 Convolutions". arXiv:1807.03039 [stat.ML]. /wiki/ArXiv_(identifier) ↩
Papamakarios, George; Nalisnick, Eric; Rezende, Danilo Jimenez; Shakir, Mohamed; Balaji, Lakshminarayanan (March 2021). "Normalizing Flows for Probabilistic Modeling and Inference". Journal of Machine Learning Research. 22 (57): 1–64. arXiv:1912.02762. https://jmlr.org/papers/v22/19-1028.html ↩
Kobyzev, Ivan; Prince, Simon J.D.; Brubaker, Marcus A. (November 2021). "Normalizing Flows: An Introduction and Review of Current Methods". IEEE Transactions on Pattern Analysis and Machine Intelligence. 43 (11): 3964–3979. arXiv:1908.09257. doi:10.1109/TPAMI.2020.2992934. ISSN 1939-3539. PMID 32396070. S2CID 208910764. https://ieeexplore.ieee.org/document/9089305 ↩
Danilo Jimenez Rezende; Mohamed, Shakir (2015). "Variational Inference with Normalizing Flows". arXiv:1505.05770 [stat.ML]. /wiki/ArXiv_(identifier) ↩
Dinh, Laurent; Krueger, David; Bengio, Yoshua (2014). "NICE: Non-linear Independent Components Estimation". arXiv:1410.8516 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Dinh, Laurent; Sohl-Dickstein, Jascha; Bengio, Samy (2016). "Density estimation using Real NVP". arXiv:1605.08803 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Kingma, Diederik P.; Dhariwal, Prafulla (2018). "Glow: Generative Flow with Invertible 1x1 Convolutions". arXiv:1807.03039 [stat.ML]. /wiki/ArXiv_(identifier) ↩
Papamakarios, George; Pavlakou, Theo; Murray, Iain (2017). "Masked Autoregressive Flow for Density Estimation". Advances in Neural Information Processing Systems. 30. Curran Associates, Inc. arXiv:1705.07057. https://proceedings.neurips.cc/paper/2017/hash/6c1da886822c67822bcf3679d04369fa-Abstract.html ↩
Kingma, Durk P; Salimans, Tim; Jozefowicz, Rafal; Chen, Xi; Sutskever, Ilya; Welling, Max (2016). "Improved Variational Inference with Inverse Autoregressive Flow". Advances in Neural Information Processing Systems. 29. Curran Associates, Inc. arXiv:1606.04934. https://proceedings.neurips.cc/paper/2016/hash/ddeebdeefdb7e7e7a697e1c3e3d8ef54-Abstract.html ↩
Grathwohl, Will; Chen, Ricky T. Q.; Bettencourt, Jesse; Sutskever, Ilya; Duvenaud, David (2018). "FFJORD: Free-form Continuous Dynamics for Scalable Reversible Generative Models". arXiv:1810.01367 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Lipman, Yaron; Chen, Ricky T. Q.; Ben-Hamu, Heli; Nickel, Maximilian; Le, Matt (2022-10-01). "Flow Matching for Generative Modeling". arXiv:2210.02747 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Grathwohl, Will; Chen, Ricky T. Q.; Bettencourt, Jesse; Sutskever, Ilya; Duvenaud, David (2018). "FFJORD: Free-form Continuous Dynamics for Scalable Reversible Generative Models". arXiv:1810.01367 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Grathwohl, Will; Chen, Ricky T. Q.; Bettencourt, Jesse; Sutskever, Ilya; Duvenaud, David (2018). "FFJORD: Free-form Continuous Dynamics for Scalable Reversible Generative Models". arXiv:1810.01367 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Grathwohl, Will; Chen, Ricky T. Q.; Bettencourt, Jesse; Sutskever, Ilya; Duvenaud, David (2018-10-22). "FFJORD: Free-form Continuous Dynamics for Scalable Reversible Generative Models". arXiv:1810.01367 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Finlay, Chris; Jacobsen, Joern-Henrik; Nurbekyan, Levon; Oberman, Adam (2020-11-21). "How to Train Your Neural ODE: the World of Jacobian and Kinetic Regularization". International Conference on Machine Learning. PMLR: 3154–3164. arXiv:2002.02798. https://proceedings.mlr.press/v119/finlay20a.html ↩
Hutchinson, M.F. (January 1989). "A Stochastic Estimator of the Trace of the Influence Matrix for Laplacian Smoothing Splines". Communications in Statistics - Simulation and Computation. 18 (3): 1059–1076. doi:10.1080/03610918908812806. ISSN 0361-0918. http://www.tandfonline.com/doi/abs/10.1080/03610918908812806 ↩
Chen, Ricky T. Q.; Rubanova, Yulia; Bettencourt, Jesse; Duvenaud, David K. (2018). "Neural Ordinary Differential Equations" (PDF). In Bengio, S.; Wallach, H.; Larochelle, H.; Grauman, K.; Cesa-Bianchi, N.; Garnett, R. (eds.). Advances in Neural Information Processing Systems. Vol. 31. Curran Associates, Inc. arXiv:1806.07366. https://proceedings.neurips.cc/paper_files/paper/2018/file/69386f6bb1dfed68692a24c8686939b9-Paper.pdf ↩
Dupont, Emilien; Doucet, Arnaud; Teh, Yee Whye (2019). "Augmented Neural ODEs". Advances in Neural Information Processing Systems. 32. Curran Associates, Inc. https://proceedings.neurips.cc/paper/2019/hash/21be9a4bd4f81549a9d1d241981cec3c-Abstract.html ↩
Zhang, Han; Gao, Xi; Unterman, Jacob; Arodz, Tom (2019-07-30). "Approximation Capabilities of Neural ODEs and Invertible Residual Networks". arXiv:1907.12998 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Finlay, Chris; Jacobsen, Joern-Henrik; Nurbekyan, Levon; Oberman, Adam (2020-11-21). "How to Train Your Neural ODE: the World of Jacobian and Kinetic Regularization". International Conference on Machine Learning. PMLR: 3154–3164. arXiv:2002.02798. https://proceedings.mlr.press/v119/finlay20a.html ↩
Sorrenson, Peter; Draxler, Felix; Rousselot, Armand; Hummerich, Sander; Köthe, Ullrich (2023). "Learning Distributions on Manifolds with Free-Form Flows". arXiv:2312.09852. /wiki/ArXiv_(identifier) ↩
Brümmer, Niko; van Leeuwen, D. A. (2006). "On calibration of language recognition scores". Proceedings of IEEE Odyssey: The Speaker and Language Recognition Workshop. San Juan, Puerto Rico. pp. 1–8. doi:10.1109/ODYSSEY.2006.248106. /wiki/Doi_(identifier) ↩
Ferrer, Luciana; Ramos, Daniel (2024). "Evaluating Posterior Probabilities: Decision Theory, Proper Scoring Rules, and Calibration". arXiv:2408.02841. /wiki/ArXiv_(identifier) ↩
Graf, Monique (2019). "The Simplicial Generalized Beta distribution - R-package SGB and applications". Libra. Retrieved 26 May 2025.{{cite web}}: CS1 maint: numeric names: authors list (link) https://libra.unine.ch/server/api/core/bitstreams/dd593778-b1fd-4856-855b-7b21e005ee77/content ↩
Brümmer, Niko (18 October 2010). Measuring, refining and calibrating speaker and language information extracted from speech (PhD thesis). Stellenbosch, South Africa: Department of Electrical & Electronic Engineering, University of Stellenbosch. https://scholar.sun.ac.za/items/1b46805b-2b1e-46aa-83ce-75ede92f0159 ↩
Sorrenson, Peter; Draxler, Felix; Rousselot, Armand; Hummerich, Sander; Köthe, Ullrich (2023). "Learning Distributions on Manifolds with Free-Form Flows". arXiv:2312.09852. /wiki/ArXiv_(identifier) ↩
The tangent matrices are not unique: if T {\displaystyle \mathbf {T} } has orthonormal columns and Q {\displaystyle \mathbf {Q} } is an orthogonal matrix, then T Q {\displaystyle \mathbf {TQ} } also has orthonormal columns that span the same subspace; it is easy to verify that | det ( T y ′ F x T x ) | {\displaystyle \left|\operatorname {det} (\mathbf {T_{y}} '\mathbf {F_{x}T_{x}} )\right|} is invariant to such transformations of the tangent representatives. /wiki/Orthogonal_matrix ↩
Sorrenson, Peter; Draxler, Felix; Rousselot, Armand; Hummerich, Sander; Köthe, Ullrich (2023). "Learning Distributions on Manifolds with Free-Form Flows". arXiv:2312.09852. /wiki/ArXiv_(identifier) ↩
With PyTorch: from torch.linalg import qr from torch.func import jacrev def logRf(pi, m, f, x): y = f(x) Fx, PI = jacrev(f)(x), jacrev(pi) Tx, Ty = [qr(PI(z)).Q[:,:m] for z in (x,y)] return (Ty.T @ Fx @ Tx).slogdet().logabsdet /wiki/PyTorch ↩
Sorrenson, Peter; Draxler, Felix; Rousselot, Armand; Hummerich, Sander; Köthe, Ullrich (2023). "Learning Distributions on Manifolds with Free-Form Flows". arXiv:2312.09852. /wiki/ArXiv_(identifier) ↩
Boulerice, Bernard; Ducharme, Gilles R. (1994). "Decentered Directional Data". Annals of the Institute of Statistical Mathematics. 46 (3): 573–586. ↩
Tyler, David E (1987). "Statistical analysis for the angular central Gaussian distribution on the sphere". Biometrika. 74 (3): 579–589. doi:10.2307/2336697. /wiki/Doi_(identifier) ↩
Helminger, Leonhard; Djelouah, Abdelaziz; Gross, Markus; Schroers, Christopher (2020). "Lossy Image Compression with Normalizing Flows". arXiv:2008.10486 [cs.CV]. /wiki/ArXiv_(identifier) ↩
Nalisnick, Eric; Matsukawa, Teh; Zhao, Yee Whye; Song, Zhao (2018). "Do Deep Generative Models Know What They Don't Know?". arXiv:1810.09136v3 [stat.ML]. /wiki/ArXiv_(identifier) ↩
Nalisnick, Eric; Matsukawa, Teh; Zhao, Yee Whye; Song, Zhao (2019). "Detecting Out-of-Distribution Inputs to Deep Generative Models Using Typicality". arXiv:1906.02994 [stat.ML]. /wiki/ArXiv_(identifier) ↩
Zhang, Lily; Goldstein, Mark; Ranganath, Rajesh (2021). "Understanding Failures in Out-of-Distribution Detection with Deep Generative Models". Proceedings of Machine Learning Research. 139: 12427–12436. PMC 9295254. PMID 35860036. https://proceedings.mlr.press/v139/zhang21g.html ↩
Caterini, Anthony L.; Loaiza-Ganem, Gabriel (2022). "Entropic Issues in Likelihood-Based OOD Detection". pp. 21–26. arXiv:2109.10794 [stat.ML]. /wiki/ArXiv_(identifier) ↩
Behrmann, Jens; Vicol, Paul; Wang, Kuan-Chieh; Grosse, Roger; Jacobsen, Jörn-Henrik (2020). "Understanding and Mitigating Exploding Inverses in Invertible Neural Networks". arXiv:2006.09347 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Ping, Wei; Peng, Kainan; Gorur, Dilan; Lakshminarayanan, Balaji (2019). "WaveFlow: A Compact Flow-based Model for Raw Audio". arXiv:1912.01219 [cs.SD]. /wiki/ArXiv_(identifier) ↩
Kingma, Diederik P.; Dhariwal, Prafulla (2018). "Glow: Generative Flow with Invertible 1x1 Convolutions". arXiv:1807.03039 [stat.ML]. /wiki/ArXiv_(identifier) ↩
Shi, Chence; Xu, Minkai; Zhu, Zhaocheng; Zhang, Weinan; Zhang, Ming; Tang, Jian (2020). "GraphAF: A Flow-based Autoregressive Model for Molecular Graph Generation". arXiv:2001.09382 [cs.LG]. /wiki/ArXiv_(identifier) ↩
Yang, Guandao; Huang, Xun; Hao, Zekun; Liu, Ming-Yu; Belongie, Serge; Hariharan, Bharath (2019). "PointFlow: 3D Point Cloud Generation with Continuous Normalizing Flows". arXiv:1906.12320 [cs.CV]. /wiki/ArXiv_(identifier) ↩
Kumar, Manoj; Babaeizadeh, Mohammad; Erhan, Dumitru; Finn, Chelsea; Levine, Sergey; Dinh, Laurent; Kingma, Durk (2019). "VideoFlow: A Conditional Flow-Based Model for Stochastic Video Generation". arXiv:1903.01434 [cs.CV]. /wiki/ArXiv_(identifier) ↩
Helminger, Leonhard; Djelouah, Abdelaziz; Gross, Markus; Schroers, Christopher (2020). "Lossy Image Compression with Normalizing Flows". arXiv:2008.10486 [cs.CV]. /wiki/ArXiv_(identifier) ↩
Rudolph, Marco; Wandt, Bastian; Rosenhahn, Bodo (2021). "Same Same But DifferNet: Semi-Supervised Defect Detection with Normalizing Flows". arXiv:2008.12577 [cs.CV]. /wiki/ArXiv_(identifier) ↩