From c9ce54c5fafa1f81ddfd3d3a9769fad8b4411482 Mon Sep 17 00:00:00 2001 From: tilakrayal <81610181+tilakrayal@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:09:37 +0530 Subject: [PATCH] Updated the Latex syntax in Variational_Inference_and_Joint_Distributions.ipynb Updated the Latex syntax in Variational_Inference_and_Joint_Distributions.ipynb --- .../Variational_Inference_and_Joint_Distributions.ipynb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tensorflow_probability/examples/jupyter_notebooks/Variational_Inference_and_Joint_Distributions.ipynb b/tensorflow_probability/examples/jupyter_notebooks/Variational_Inference_and_Joint_Distributions.ipynb index 604d7c8663..f54dc5f31f 100644 --- a/tensorflow_probability/examples/jupyter_notebooks/Variational_Inference_and_Joint_Distributions.ipynb +++ b/tensorflow_probability/examples/jupyter_notebooks/Variational_Inference_and_Joint_Distributions.ipynb @@ -85,11 +85,12 @@ "## Overview of Bayesian Variational Inference\n", "\n", "Suppose we have the following generative process, where $\\theta$ represents random parameters, $\\omega$ represents deterministic parameters, and the $x_i$ are features and the $y_i$ are target values for $i=1,\\ldots,n$ observed data points:\n", - "\\begin{align*}\n", + "\n", + "$$\\begin{align*}\n", "&\\theta \\sim r(\\Theta) && \\text{(Prior)}\\\\\n", "&\\text{for } i = 1 \\ldots n: \\nonumber \\\\\n", "&\\quad y_i \\sim p(Y_i|x_i, \\theta, \\omega) && \\text{(Likelihood)}\n", - "\\end{align*}\n", + "\\end{align*}$$\n", "\n", "VI is then characterized by:\n", "$\\newcommand{\\E}{\\operatorname{\\mathbb{E}}}\n", @@ -97,14 +98,14 @@ "\\newcommand{\\defeq}{\\overset{\\tiny\\text{def}}{=}}\n", "\\DeclareMathOperator*{\\argmin}{arg\\,min}$\n", "\n", - "\\begin{align*}\n", + "$$\\begin{align*}\n", "-\\log p(\\{y_i\\}_i^n|\\{x_i\\}_i^n, \\omega)\n", "&\\defeq -\\log \\int \\textrm{d}\\theta\\, r(\\theta) \\prod_i^n p(y_i|x_i,\\theta, \\omega) && \\text{(Really hard integral)} \\\\\n", "&= -\\log \\int \\textrm{d}\\theta\\, q(\\theta) \\frac{1}{q(\\theta)} r(\\theta) \\prod_i^n p(y_i|x_i,\\theta, \\omega) && \\text{(Multiply by 1)}\\\\\n", "&\\le - \\int \\textrm{d}\\theta\\, q(\\theta) \\log \\frac{r(\\theta) \\prod_i^n p(y_i|x_i,\\theta, \\omega)}{q(\\theta)} && \\text{(Jensen's inequality)}\\\\\n", "&\\defeq \\E_{q(\\Theta)}[ -\\log p(y_i|x_i,\\Theta, \\omega) ] + \\K[q(\\Theta), r(\\Theta)]\\\\\n", "&\\defeq ``\\text{expected negative log likelihood\"} + ``\\text{kl regularizer\"}\n", - "\\end{align*}\n", + "\\end{align*}$$\n", "\n", "(Technically we're assuming $q$ is [absolutely continuous](https://en.wikipedia.org/wiki/Absolute_continuity#Absolute_continuity_of_measures) with respect to $r$. See also, [Jensen's inequality](https://en.wikipedia.org/wiki/Jensen%27s_inequality).)\n", "\n",