You will be shown an excerpt from a computer science scientific research paper, followed by a question about the paper. Please answer the question. Do not include any text in your response other than the answer.

Context: How can we perform efficient approximate inference and learning with directed probabilistic modelswhose continuous latent variables and/or parameters have intractable posterior distributions?The variational Bayesian (VB) approach involves the optimization of an approximation to the intractable posterior. Unfortunately, the common mean-field approach requires analytical solutions of expectations w.r.t. the approximate posterior, which are also intractable in the general case. We show how a reparameterization of the variational lower bound yields a simple differentiable unbiased estimator of the lower bound; this SGVB (Stochastic Gradient Variational Bayes) estimator can be used for efficient approximate posterior inference in almost any model with continuous latent variables and/or parameters, and is straightforward to optimize using standard stochastic gradient ascent techniques. Under certain mild conditions outlined in section 2.4 for a chosen approximate posterior q_{\boldsymbol{\phi}}(\mathbf{z}|\mathbf{x}) we can reparameterize the random variable \widetilde{\mathbf{z}}\sim q_{\boldsymbol{\phi}}(\mathbf{z}|\mathbf{x}) using a differentiable transformation g_{\boldsymbol{\phi}}(\boldsymbol{\epsilon},\mathbf{x}) of an (auxiliary) noise variable \boldsymbol{\epsilon}:\displaystyle\widetilde{\mathbf{z}}=g_{\boldsymbol{\phi}}(\boldsymbol{\epsilon},\mathbf{x})\text{\quad with \quad}\boldsymbol{\epsilon}\sim p(\boldsymbol{\epsilon})(4)See section 2.4 for general strategies for chosing such an approriate distribution p(\boldsymbol{\epsilon}) and function g_{\boldsymbol{\phi}}(\boldsymbol{\epsilon},\mathbf{x}).We can now form Monte Carlo estimates of expectations of some function f(\mathbf{z}) w.r.t. q_{\boldsymbol{\phi}}(\mathbf{z}|\mathbf{x}) as follows:\displaystyle\mathbb{E}_{q_{\boldsymbol{\phi}}(\mathbf{z}|\mathbf{x}^{(i)})}\left[f(\mathbf{z})\right]=\mathbb{E}_{p(\boldsymbol{\epsilon})}\left[f(g_{\boldsymbol{\phi}}(\boldsymbol{\epsilon},\mathbf{x}^{(i)}))\right]\displaystyle\simeq\frac{1}{L}\sum_{l=1}^{L}{f(g_{\boldsymbol{\phi}}(\boldsymbol{\epsilon}^{(l)},\mathbf{x}^{(i)}))}\text{\quad where \quad}\boldsymbol{\epsilon}^{(l)}\sim p(\boldsymbol{\epsilon})(5)We apply this technique to the variational lower bound (eq. (2)), yielding our generic Stochastic Gradient Variational Bayes (SGVB) estimator \widetilde{\mathcal{L}}^{A}(\boldsymbol{\theta},\boldsymbol{\phi};\mathbf{x}^{(i)})\simeq\mathcal{L}(\boldsymbol{\theta},\boldsymbol{\phi};\mathbf{x}^{(i)}):\displaystyle\widetilde{\mathcal{L}}^{A}(\boldsymbol{\theta},\boldsymbol{\phi};\mathbf{x}^{(i)})\displaystyle=\frac{1}{L}\sum_{l=1}^{L}\log p_{\boldsymbol{\theta}}(\mathbf{x}^{(i)},\mathbf{z}^{(i,l)})-\log q_{\boldsymbol{\phi}}(\mathbf{z}^{(i,l)}|\mathbf{x}^{(i)})\displaystyle\text{where \quad}\mathbf{z}^{(i,l)}\displaystyle=g_{\boldsymbol{\phi}}(\boldsymbol{\epsilon}^{(i,l)},\mathbf{x}^{(i)})\text{\quad and \quad}\boldsymbol{\epsilon}^{(l)}\sim p(\boldsymbol{\epsilon})(6)Often, the KL-divergence DK⁢L(qϕ(𝐳|𝐱(i))||p𝜽(𝐳))D_{KL}(q_{\boldsymbol{\phi}}(\mathbf{z}|\mathbf{x}^{(i)})||p_{\boldsymbol{\theta}}(\mathbf{z}))italic_D start_POSTSUBSCRIPT italic_K italic_L end_POSTSUBSCRIPT ( italic_q start_POSTSUBSCRIPT bold_italic_ϕ end_POSTSUBSCRIPT ( bold_z | bold_x start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ) | | italic_p start_POSTSUBSCRIPT bold_italic_θ end_POSTSUBSCRIPT ( bold_z ) ) of eq. (3) can be integrated analytically (see appendix B), such that only the expected reconstruction error \mathbb{E}_{q_{\boldsymbol{\phi}}(\mathbf{z}|\mathbf{x}^{(i)})}\left[\log p_{\boldsymbol{\theta}}(\mathbf{x}^{(i)}|\mathbf{z})\right] requires estimation by sampling. The KL-divergence term can then be interpreted as regularizing \boldsymbol{\phi}, encouraging the approximate posterior to be close to the prior p_{\boldsymbol{\theta}}(\mathbf{z}).This yields a second version of the SGVB estimator \widetilde{\mathcal{L}}^{B}(\boldsymbol{\theta},\boldsymbol{\phi};\mathbf{x}^{(i)})\simeq\mathcal{L}(\boldsymbol{\theta},\boldsymbol{\phi};\mathbf{x}^{(i)}), corresponding to eq. (3), which typically has less variance than the generic estimator:\displaystyle\widetilde{\mathcal{L}}^{B}(\boldsymbol{\theta},\boldsymbol{\phi};\mathbf{x}^{(i)})=−DK⁢L(qϕ(𝐳|𝐱(i))||p𝜽(𝐳))+1L∑l=1L(logp𝜽(𝐱(i)|𝐳(i,l)))\displaystyle=-D_{KL}(q_{\boldsymbol{\phi}}(\mathbf{z}|\mathbf{x}^{(i)})||p_{\boldsymbol{\theta}}(\mathbf{z}))+\frac{1}{L}\sum_{l=1}^{L}(\log p_{\boldsymbol{\theta}}(\mathbf{x}^{(i)}|\mathbf{z}^{(i,l)}))= - italic_D start_POSTSUBSCRIPT italic_K italic_L end_POSTSUBSCRIPT ( italic_q start_POSTSUBSCRIPT bold_italic_ϕ end_POSTSUBSCRIPT ( bold_z | bold_x start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ) | | italic_p start_POSTSUBSCRIPT bold_italic_θ end_POSTSUBSCRIPT ( bold_z ) ) + divide start_ARG 1 end_ARG start_ARG italic_L end_ARG ∑ start_POSTSUBSCRIPT italic_l = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_L end_POSTSUPERSCRIPT ( roman_log italic_p start_POSTSUBSCRIPT bold_italic_θ end_POSTSUBSCRIPT ( bold_x start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT | bold_z start_POSTSUPERSCRIPT ( italic_i , italic_l ) end_POSTSUPERSCRIPT ) )\displaystyle\text{where \quad}\mathbf{z}^{(i,l)}\displaystyle=g_{\boldsymbol{\phi}}(\boldsymbol{\epsilon}^{(i,l)},\mathbf{x}^{(i)})\text{\quad and \quad}\boldsymbol{\epsilon}^{(l)}\sim p(\boldsymbol{\epsilon})(7)Given multiple datapoints from a dataset \mathbf{X} with N datapoints, we can construct an estimator of the marginal likelihood lower bound of the full dataset, based on minibatches:\displaystyle\mathcal{L}(\boldsymbol{\theta},\boldsymbol{\phi};\mathbf{X})\simeq\widetilde{\mathcal{L}}^{M}(\boldsymbol{\theta},\boldsymbol{\phi};\mathbf{X}^{M})=\frac{N}{M}\sum_{i=1}^{M}\widetilde{\mathcal{L}}(\boldsymbol{\theta},\boldsymbol{\phi};\mathbf{x}^{(i)})(8)where the minibatch \mathbf{X}^{M}=\{\mathbf{x}^{(i)}\}_{i=1}^{M} is a randomly drawn sample of M datapoints from the full dataset \mathbf{X} with N datapoints. In our experiments we found that the number of samples L per datapoint can be set to 1 as long as the minibatch size M was large enough, e.g. M=100. Derivatives \nabla_{\boldsymbol{\theta},\boldsymbol{\phi}}\widetilde{\mathcal{L}}(\boldsymbol{\theta};\mathbf{X}^{M}) can be taken, and the resulting gradients can be used in conjunction with stochastic optimization methods such as SGD or Adagrad [DHS10]. See algorithm 1 for a basic approach to compute the stochastic gradients. The strategy in this section can be used to derive a lower bound estimator (a stochastic objective function) for a variety of directed graphical models with continuous latent variables. We will restrict ourselves here to the common case where we have an i.i.d. dataset with latent variables per datapoint, and where we like to perform maximum likelihood (ML) or maximum a posteriori (MAP) inference on the (global) parameters, and variational inference on the latent variables. It is, for example, straightforward to extend this scenario to the case where we also perform variational inference on the global parameters; that algorithm is put in the appendix, but experiments with that case are left to future work. Note that our method can be applied to online, non-stationary settings, e.g. streaming data, but here we assume a fixed dataset for simplicity. Stochastic variational inference [HBWP13] has recently received increasing interest. Recently, [BJP12] introduced a control variate schemes to reduce the high variance of the naïve gradient estimator discussed in section 2.1, and applied to exponential family approximations of the posterior. In [RGB13] some general methods, i.e. a control variate scheme, were introduced for reducing the variance of the original gradient estimator. In [SK13], a similar reparameterization as in this paper was used in an efficient version of a stochastic variational inference algorithm for learning the natural parameters of exponential-family approximating distributions. Parameters are updated using stochastic gradient ascent where gradients are computed by differentiating the lower bound estimator \nabla_{\boldsymbol{\theta},\boldsymbol{\phi}}\mathcal{L}(\boldsymbol{\theta},\boldsymbol{\phi};\mathbf{X}) (see algorithm  1), plus a small weight decay term corresponding to a prior p(\boldsymbol{\theta})=\mathcal{N}(0,\mathbf{I}). Optimization of this objective is equivalent to approximate MAP estimation, where the likelihood gradient is approximated by the gradient of the lower bound. We have introduced a novel estimator of the variational lower bound, Stochastic Gradient VB (SGVB), for efficient approximate inference with continuous latent variables. The proposed estimator can be straightforwardly differentiated and optimized using standard stochastic gradient methods. For the case of i.i.d. datasets and continuous latent variables per datapoint we introduce an efficient algorithm for efficient inference and learning, Auto-Encoding VB (AEVB), that learns an approximate inference model using the SGVB estimator. The theoretical advantages are reflected in experimental results.

Question: How to obtain SGVB estimator from variational lower bound?
Authors apply Monte Carlo estimates of expectations of some function f(\mathbf{z}) w.r.t. q_{\boldsymbol{\phi}}(\mathbf{z}|\mathbf{x}) to the variational lower bound (eq. (2)), yielding generic Stochastic Gradient Variational Bayes (SGVB) estimator. The KL-diverdnence in eq. (3) can be integrated, such that only the reconstruction error requires estimation by sampling. The KL-divergence term regularizes \phi, encouraging the approximate posterior to be close to the prior p_\theta(z) yielding a SGVB estimator. Parameters are updated using stochastic gradient ascent where gradients are computed by differentiating the lower bound estimator.