Skip to content

Commit

Permalink
fix notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
CHUN-HAO TO committed Mar 9, 2022
1 parent 8c19281 commit e9e6f9b
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions docs/notebooks/multivariate_gaussian_distribution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "bb9ce462",
"id": "cf172a64",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -18,15 +18,15 @@
},
{
"cell_type": "markdown",
"id": "a2f0fbbf",
"id": "72cca938",
"metadata": {},
"source": [
"In this notebook, we sample a 2d gaussian posterior using LINNA. LINNA isn't designed for low dimension posteiors, so the performance will not be great. However, this notebook illustrates how one can use LINNA to sample posteriors. "
]
},
{
"cell_type": "markdown",
"id": "10743380",
"id": "ae184c0a",
"metadata": {},
"source": [
"# Create a multivariate gaussian distribution "
Expand All @@ -35,7 +35,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "a4a8c4fa",
"id": "c0893db6",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -65,7 +65,7 @@
},
{
"cell_type": "markdown",
"id": "e80d182a",
"id": "4e936434",
"metadata": {},
"source": [
"# Perform MCMC sampling using Linna"
Expand All @@ -74,7 +74,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "86cf1a71",
"id": "19103732",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -85,7 +85,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "a688cd37",
"id": "27d1fd82",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -204,7 +204,7 @@
},
{
"cell_type": "markdown",
"id": "373abca6",
"id": "f004d94b",
"metadata": {},
"source": [
"# Check the result"
Expand All @@ -213,7 +213,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "0c50186c",
"id": "cee5428f",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -223,7 +223,7 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "b63b40bd",
"id": "1c673921",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -259,15 +259,15 @@
},
{
"cell_type": "markdown",
"id": "4ea71bed",
"id": "831779a5",
"metadata": {},
"source": [
"# Useful performance check tools"
]
},
{
"cell_type": "markdown",
"id": "8572b276",
"id": "d4b3bec9",
"metadata": {},
"source": [
"The output of linna has the following struture."
Expand All @@ -276,7 +276,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "940aab44",
"id": "4ee3408e",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -384,7 +384,7 @@
},
{
"cell_type": "markdown",
"id": "ca9a4769",
"id": "2a0fc5d9",
"metadata": {},
"source": [
"In each iteration, \n",
Expand All @@ -402,16 +402,25 @@
},
{
"cell_type": "markdown",
"id": "2545f502",
"id": "ef4a2850",
"metadata": {},
"source": [
"Note that if your job crashs at an iteration, LINNA can be restarted from the previous iteration by cleanining the directories corresponding to the crashed iteration and rerunning the code. "
]
},
{
"cell_type": "markdown",
"id": "aa39713c",
"metadata": {},
"source": [
"#### To retrieve the model \n",
"One might wish to use the learned model to perform fast model evaluation. This can be done with the following functions. "
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "05b5ecc3",
"id": "df72d84a",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -421,7 +430,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "2c1d75d8",
"id": "a32c8eb4",
"metadata": {
"scrolled": true
},
Expand All @@ -442,7 +451,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "0ef1c004",
"id": "64cd2284",
"metadata": {},
"outputs": [
{
Expand Down

0 comments on commit e9e6f9b

Please sign in to comment.