Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
ziatdinovmax committed Nov 3, 2024
1 parent 31c9ef6 commit 3d2114d
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions examples/pretrained_priors.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## BNN with pre-trained, theory-informed priors"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*Prepared by Maxim Ziatdinov (October 2024)*"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Imports"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand All @@ -20,7 +41,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Define imaginary theoretical and experimental data:"
"Define synthetic theoretical and experimental data:"
]
},
{
Expand Down Expand Up @@ -123,7 +144,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"Training Progress: 100%|██████████| 5000/5000 [00:05<00:00, 927.39it/s, Epoch 5000/5000, Avg Loss: 1.8260] \n"
"Training Progress: 100%|██████████| 5000/5000 [00:03<00:00, 1343.86it/s, Epoch 5000/5000, Avg Loss: 1.8260]\n"
]
}
],
Expand Down Expand Up @@ -185,7 +206,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"sample: 100%|██████████| 2000/2000 [01:29<00:00, 22.44it/s, 1023 steps of size 1.48e-03. acc. prob=0.84]\n"
"sample: 100%|██████████| 2000/2000 [01:23<00:00, 23.90it/s, 1023 steps of size 1.48e-03. acc. prob=0.84]\n"
]
}
],
Expand Down Expand Up @@ -240,6 +261,13 @@
"plt.show()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Store the MSE and NLPD values"
]
},
{
"cell_type": "code",
"execution_count": 8,
Expand All @@ -266,7 +294,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"sample: 100%|██████████| 2000/2000 [00:48<00:00, 41.40it/s, 511 steps of size 1.14e-02. acc. prob=0.85]\n"
"sample: 100%|██████████| 2000/2000 [00:43<00:00, 45.87it/s, 511 steps of size 1.14e-02. acc. prob=0.85]\n"
]
}
],
Expand Down Expand Up @@ -380,7 +408,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"sample: 100%|██████████| 2000/2000 [00:01<00:00, 1666.85it/s, 7 steps of size 3.91e-01. acc. prob=0.94] "
"sample: 100%|██████████| 2000/2000 [00:01<00:00, 1927.15it/s, 7 steps of size 3.91e-01. acc. prob=0.94]"
]
},
{
Expand Down Expand Up @@ -487,13 +515,6 @@
"ax2.set_ylabel(\"NLPD\")\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 3d2114d

Please sign in to comment.