use all the standard tools.

Typically, we use importance sampling to find the expectation of a function $f(z)$ over the target distribution $p(z)$ if we are able to draw samples only from a proposal distribution $q(z)$. The expectation of $f(z)$ over $p(z)$ can then be approximated by The quantities $w_m = {p(z_m)}/ {q(z_m)}$ are the *importance weights* that correct the bias introduced by sampling from the wrong distribution $q(z)$ [@bishop]. The weights $w_m$ are non-negative and tend to zero when $p(z)$ is completely mismatched to $q(z)$, and $w_m > 1$ when the sample $z_m$ is more likely under the $p(z)$. The estimate above is unbiased, but has high – potentially infinite – variance when $q(z)$ and $p(z)$ are dissimilar. Next we show how importance sampling can be used for evaluating the reparameterization gradient .

To save computation we want to re-use the model gradients $\nabla_z
\log p(x, z_m)$ already available for certain values of $z_m$ and hence need to consider estimates that keep these values fixed. This means we need to find the $\epsilon_m'$ under the new approximation $q_{\lambda'}(z)$ that correspond to these values, by computing $\epsilon_m' = f^{-1}(z_m, \lambda')$. Given these values we can evaluate the necessary quantities to 