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:

  1. 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)$
  2. 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.


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:

  1. 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.
  2. 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.
  3. It allows exact calculation of the latent representation of a given sample. Again, this is a consequence of the invertible nature of the NF.
  4. 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.

  • $\begingroup$ This is only partly true. The IAF you mention is very slow when used for likelihood calculation on external samples. Furthermore, there are normalizing flows that slow / impossible to sample from, for example MAF or inverted Planar Flows. Really, in picking a NF you often trade off between: 1) Expressiveness, 2) Speed of sampling, 3) Speed of likelihood calculation for external samples (=Speed of calculating the inverse). RealNVP: Good at 2) and 3), but not very expressive. IAF: Good at 1) and 2), slow for 3). $\endgroup$ – Simon Böhm Aug 25 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.