Related Methods¶
- Deep Density Destructors
- Main Idea
- Normalizing Flows
- Loss Function
- Sampling
- Choice of Transformations
- Prior Distribution
- Jacobian
- Resources
- Survey of Literature
- Neural Density Estimators
- Deep Density Destructors
- Code Tutorials
- Tutorials
- Algorithms
- RBIG Upgrades
- Cutting Edge
- Github Implementations
Deep Density Destructors¶
Main Idea¶
We can view the approach of modeling from two perspectives: constructive or destructive. A constructive process tries to learn how to build an exact sequence of transformations to go from
We can write some equations to illustrate exactly what we mean by these two terms. Let's define two spaces: one is our data space
TODO: Plot
More concretely, let's define the following pair of equations:
This is called the generative step; how well do we fit our parameters such that
This is called the inference step: how well do we fit the parameters of our transformation
Normalizing Flows¶
Distribution flows through a sequence of invertible transformations - Rezende & Mohamed (2015)
We want to fit a density model
- Modeling: Find the underlying distribution for the training data.
- Probability: For a new
, we want to be able to evaluate - Sampling: We also want to be able to generate samples from
. - Latent Representation: Ideally we want this representation to be meaningful.
Let's assume that we can find some probability distribution for
We'll define this as
- We want this
to be defined by a probabilistic function and have a valid distribution - We also would prefer this distribution to be simply. We typically pick a normal distribution,
We begin with in initial distribution and then we apply a sequence of
Loss Function¶
We can do a simple maximum-likelihood of our distribution
However, this expression needs to be transformed in terms of the invertible functions
So now, we can do the same maximization function but with our change of variables formulation:
And we can optimize this using stochastic gradient descent (SGD) which means we can use all of the autogradient and deep learning libraries available to make this procedure relatively painless.
Sampling¶
If we want to sample from our base distribution
where
or the same but only in terms of the original distribution
We can make this transformation a bit easier to handle empirically by calculating the Log-Transformation of this expression. This removes the inverse and introduces a summation of each of the transformations individually which gives us many computational advantages.
So now, our original expression with
TODO: Diagram with plots of the Normalizing Flow distributions which show the direction for the idea.
In order to train this, we need to take expectations of the transformations.
Choice of Transformations¶
The main thing that many of the communities have been looking into is how one chooses the aspects of the normalizing flow: the prior distribution and the Jacobian.
Prior Distribution¶
This is very consistent across the literature: most people use a fully-factorized Gaussian distribution. Very simple.
Jacobian¶
This is the area of the most research within the community. There are many different complicated frameworks but almost all of them can be put into different categories for how the Jacobian is constructed.
Resources¶
Best Tutorials¶
- Flow-Based Deep Generative Models - Lilian Weng
An excellent blog post for Normalizing Flows. Probably the most thorough introduction available.
- Flow Models - Deep Unsupervised Learning Class, Spring 2010
- Normalizing Flows: A Tutorial - Eric Jang
Survey of Literature¶
Neural Density Estimators¶
Deep Density Destructors¶
Code Tutorials¶
- Building Prob Dist with TF Probability Bijector API - Blog
- https://www.ritchievink.com/blog/2019/10/11/sculpting-distributions-with-normalizing-flows/
Tutorials¶
- RealNVP - code I
- Normalizing Flows: Intro and Ideas - Kobyev et. al. (2019)
Algorithms¶
*
RBIG Upgrades¶
- Modularization
- Lucastheis
- Destructive-Deep-Learning
- TensorFlow
- NormalCDF
- interp_regular_1d_grid
- IT w. TF
Cutting Edge¶
- Neural Spline Flows - Github
- Complete | PyTorch
- PointFlow: 3D Point Cloud Generations with Continuous Normalizing Flows - Project
- PyTorch
- Conditional Density Estimation with Bayesian Normalising Flows | Code