Normalizing Flows, Real NVPs and Inverse Autoregressive Flows - Used for Probabilty Density Approximation or for Sampling? Suppose we have a parametric family $g(x;\theta)$, where $\theta$ are the parameters. As far as I can tell, there are two ways we can use this family to model a probability distribution:


*

*Probability density approximation: We can train $g(x;\theta)$ to be very similar to some desired probability distribution $p(x)$, such that for every $x$, $g(x;\theta)\approx p(x)$

*Sampling: We can train $g(x;\theta)$ so that it approximately generates samples of a desired random vector $X$: If we feed $g$ with some random input, say $Z\sim\mathcal{N}(0,I)$, then the distribution of the random vector $g(Z;\theta)$ is similar to the distribution of $X$.


I know that in the field of Bayesian inference, there have been a lot of work lately about creating flexible models $g(x;\theta)$ for probabilistic modeling. Specifically, I'm referring to normalizing flows, real NVPs and inverse autoregressive flows.
I'm confused as to whether these methods are addressing probability density approximation or sampling, or both.
 A: Real-valued non-volume preserving (RNVP) and inverse autoregressive flows (IARF) are two instances of the general idea of normalizing flows (NF).
An NF is a method that constructs a probability distribution density (pdf) with the following useful properties:


*

*It is easy to sample from the pdf. This is done by feeding the NF with a random input vector (in some contexts this is called a latent representation) sampled from a simple pre-defined pdf, such as a uniform density in a hypercube or a standard factored Gaussian. The NF applies a sequence of deterministic functions to the input to produce the output sample. 

*It allows an exact calculation of the probability density of a given sample. This is possible since the NF works by applying a sequence of functions on the input, and these functions are all differentiable and invertible, therefore the change of variables formula can be used.

*It allows exact calculation of the latent representation of a given sample. Again, this is a consequence of the invertible nature of the NF.

*It can be used to approximate (a) a given pdf; or (b) the pdf that created a given data set. This is a consequence of the NF being a flexible function approximator. This means that the NF depends on a set of parameters, and the outputs of the NF are all differentiable with respect to these parameters. Therefore, the NF can be optimized using methods such as gradient-descent so as to become very similar to the given pdf (in case a), or to yield a pdf that achieves high likelihood on the data set (in case b). The "flexible" part means that function approximator has the capacity to approximate a wide variety of functions.


IARF and RNVP are distinguished by the specific types of sequences of invertible functions that they use to transform the input random vector to an output sample.
