Created using Colaboratory

This commit is contained in:
udlbook
2023-12-10 17:06:17 +00:00
parent de1e19ace9
commit 40fc192198

View File

@@ -4,7 +4,7 @@
"metadata": { "metadata": {
"colab": { "colab": {
"provenance": [], "provenance": [],
"authorship_tag": "ABX9TyMpC8kgLnXx0XQBtwNAQ4jJ", "authorship_tag": "ABX9TyNHifufahHPhghaXpcrZ7c5",
"include_colab_link": true "include_colab_link": true
}, },
"kernelspec": { "kernelspec": {
@@ -233,7 +233,7 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"source": [ "source": [
"Notice that the samples have a tendency to move toward the center. Now let's look at the histogram of the samples at each stage" "Notice that the samples have a tendencey to move toward the center. Now let's look at the histogram of the samples at each stage"
], ],
"metadata": { "metadata": {
"id": "SGTYGGevAktz" "id": "SGTYGGevAktz"
@@ -248,7 +248,7 @@
" plt.hist(z_t , bins=np.arange(-3,3, 0.1), density = True)\n", " plt.hist(z_t , bins=np.arange(-3,3, 0.1), density = True)\n",
" ax.set_xlim([-3,3])\n", " ax.set_xlim([-3,3])\n",
" ax.set_ylim([0,1.0])\n", " ax.set_ylim([0,1.0])\n",
" ax.set_title('title')\n", " ax.set_title(title)\n",
" plt.show()" " plt.show()"
], ],
"metadata": { "metadata": {
@@ -418,7 +418,7 @@
" # 1. For each x (value in x_plot_vals):\n", " # 1. For each x (value in x_plot_vals):\n",
" # 2. Compute the mean and variance of the diffusion kernel at time t\n", " # 2. Compute the mean and variance of the diffusion kernel at time t\n",
" # 3. Compute pdf of this Gaussian at every x_plot_val\n", " # 3. Compute pdf of this Gaussian at every x_plot_val\n",
" # 4. Weight Gaussian by probability at position x and by 0.01 to compensate for bin size\n", " # 4. Weight Gaussian by probability at position x and by 0.01 to componensate for bin size\n",
" # 5. Accumulate weighted Gaussian in marginal at time t.\n", " # 5. Accumulate weighted Gaussian in marginal at time t.\n",
" # 6. Multiply result by 0.01 to compensate for bin size\n", " # 6. Multiply result by 0.01 to compensate for bin size\n",
" # Replace this line:\n", " # Replace this line:\n",