it has not already been evaluated because of being used for another importance sampling estimate.

To compute the gradient we need to re-compute $\nabla_{\lambda} f(\epsilon_m', \lambda')$ and $\nabla_{\lambda}|\text{det}_{J_f}(\epsilon'_m, \lambda')|$. For $\mu$ these terms are simply identity and zero, whereas for $L$ we get $z_m$ and $\nabla_{L} \log |L'| \equiv \Delta_{L'}$. The exact form of $\Delta_{L'}$ depends on the assumptions made for $L$; see @dsvi for details. The final importance sampled estimate for the gradient is then $$\begin{aligned}
  \nabla_{\mu}^{i} \mathcal{L}(\mu', L') &\approx
  \frac{1}{M} \sum_{m=1}^M w_m \nabla_{z} \log p(x, z_m)\\
  \nabla_{L}^{i} \mathcal{L}(\mu', L') &\approx \frac{1}{M}
  \sum_{m=1}^M w_m \left [ \nabla_{z} \log p(x, z_m)
    \epsilon'_m     + \Delta_{L'} \right ]. \notag\end{aligned}$$

An important observation here is that the importance sampling procedure does not merely re-weight the terms $\nabla_z \log p(x,
z_m)$, but in addition the transformation that converts them into the $\lambda$ space changes because of the new values of $\epsilon_m'$. These values depend on the approximation parameters in a non-linear fashion and hence the gradient itself is a non-linear transformation of the gradient evaluated at $\lambda$ (for a graphical illustration, see Figure \[fig:normalcontour\]). This is crucially important for development of the practical optimization algorithms in Section \[sec:algorithms\]; if the transformation was linear then 