Using normalizing flows, we can model model's posteriors $p(\theta|D)$, by feeding Gaussian noise $z$ to the NF (parametrized with $\phi$), using the output of the NF $\theta$ as model parameters, and then computing the loss. At that point, we can compute $\nabla \log p(x) = \frac{dL}{d\theta}\frac{d\theta}{d\phi}$, to which we add the log-determinant to account for the change of variable.
At that point, the NF will produce $\theta\sim p(\theta|D)$, so we successfully have approximated the posterior using a NF
However, I was wondering if this is a special case of NF, or if any generative model is able to do so. However, trying to fit this framework into the VAE world, I'm not so sure how to approach it.
The problem I'm facing with this reasoning, is that VAEs require to have samples from the intended distribution, and then just "make such samples likely under the model", where instead the NF is (in very poor words) a change of variable
Maybe something like this, with importance sampling: $$ \max_\theta \mathbb{E}_{p(x)}[\log p_\theta(x)] = \max_\theta \mathbb{E}_{q(x)}[\frac{p(x)}{q(x)}\log p_\theta(x)] $$ Instead of $\log p(x)$ we would put ELBO
so like if we have a set of weights $\theta$, we feed it through the VAE, calculate the ELBO, and weight each sample loss by the posterior likelihood (loss produced by that set of weights)