Skip to content

Commit

Permalink
Move notebook to docs/source/notebooks folder
Browse files Browse the repository at this point in the history
  • Loading branch information
LouieMH committed Dec 4, 2024
1 parent de65b49 commit e3994fc
Showing 1 changed file with 44 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"cells": [
{
"cell_type": "code",
"execution_count": 34,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"from IPython.utils import io"
"from IPython.utils import io # I made a change - Is this visible in Github?"
]
},
{
Expand All @@ -24,7 +24,7 @@
},
{
"cell_type": "code",
"execution_count": 80,
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -45,17 +45,29 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 19,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "NameError",
"evalue": "name 'jax' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[19], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Disable JIT compilation globally\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m \u001b[43mjax\u001b[49m\u001b[38;5;241m.\u001b[39mconfig\u001b[38;5;241m.\u001b[39mupdate(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mjax_disable_jit\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mFalse\u001b[39;00m) \u001b[38;5;66;03m# True - If I want the compiler disabled.\u001b[39;00m\n",
"\u001b[1;31mNameError\u001b[0m: name 'jax' is not defined"
]
}
],
"source": [
"# Disable JIT compilation globally\n",
"jax.config.update(\"jax_disable_jit\", False) # True - If I want the compiler disabled."
]
},
{
"cell_type": "code",
"execution_count": 62,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -71,7 +83,7 @@
},
{
"cell_type": "code",
"execution_count": 63,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -122,10 +134,10 @@
"</svg>\n"
],
"text/plain": [
"<graphviz.sources.Source at 0x19f37284770>"
"<graphviz.sources.Source at 0x209b3f58da0>"
]
},
"execution_count": 63,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -136,7 +148,7 @@
},
{
"cell_type": "code",
"execution_count": 68,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -154,7 +166,7 @@
},
{
"cell_type": "code",
"execution_count": 69,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -205,10 +217,10 @@
"</svg>\n"
],
"text/plain": [
"<graphviz.sources.Source at 0x19f3bb46cc0>"
"<graphviz.sources.Source at 0x209b3ff1eb0>"
]
},
"execution_count": 69,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -219,7 +231,7 @@
},
{
"cell_type": "code",
"execution_count": 64,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -229,7 +241,7 @@
},
{
"cell_type": "code",
"execution_count": 65,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -249,7 +261,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -262,7 +274,7 @@
},
{
"cell_type": "code",
"execution_count": 54,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -272,7 +284,7 @@
},
{
"cell_type": "code",
"execution_count": 55,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand All @@ -292,7 +304,7 @@
},
{
"cell_type": "code",
"execution_count": 71,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -310,7 +322,7 @@
},
{
"cell_type": "code",
"execution_count": 72,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -361,10 +373,10 @@
"</svg>\n"
],
"text/plain": [
"<graphviz.sources.Source at 0x19f3cb872c0>"
"<graphviz.sources.Source at 0x209b7c81730>"
]
},
"execution_count": 72,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -375,7 +387,7 @@
},
{
"cell_type": "code",
"execution_count": 73,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -386,7 +398,7 @@
},
{
"cell_type": "code",
"execution_count": 81,
"execution_count": 16,
"metadata": {},
"outputs": [
{
Expand All @@ -396,7 +408,7 @@
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mKeyError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[81], line 17\u001b[0m\n\u001b[0;32m 15\u001b[0m l_a \u001b[38;5;241m=\u001b[39m attributes[\u001b[38;5;241m1\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mexpected_mean\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m 16\u001b[0m w_b \u001b[38;5;241m=\u001b[39m attributes[\u001b[38;5;241m2\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mexpected_mean\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m---> 17\u001b[0m l_b \u001b[38;5;241m=\u001b[39m \u001b[43mattributes\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m3\u001b[39;49m\u001b[43m]\u001b[49m[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mexpected_mean\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m 19\u001b[0m \u001b[38;5;66;03m# the decision function\u001b[39;00m\n\u001b[0;32m 20\u001b[0m p_a \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mexp(beta \u001b[38;5;241m*\u001b[39m (w_a \u001b[38;5;241m-\u001b[39m l_a)) \u001b[38;5;241m/\u001b[39m (\n\u001b[0;32m 21\u001b[0m np\u001b[38;5;241m.\u001b[39mexp(beta \u001b[38;5;241m*\u001b[39m (w_a \u001b[38;5;241m-\u001b[39m l_a)) \u001b[38;5;241m+\u001b[39m np\u001b[38;5;241m.\u001b[39mexp(beta \u001b[38;5;241m*\u001b[39m (w_b \u001b[38;5;241m-\u001b[39m l_b))\n\u001b[0;32m 22\u001b[0m )\n",
"Cell \u001b[1;32mIn[16], line 17\u001b[0m\n\u001b[0;32m 15\u001b[0m l_a \u001b[38;5;241m=\u001b[39m attributes[\u001b[38;5;241m1\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mexpected_mean\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m 16\u001b[0m w_b \u001b[38;5;241m=\u001b[39m attributes[\u001b[38;5;241m2\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mexpected_mean\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m---> 17\u001b[0m l_b \u001b[38;5;241m=\u001b[39m \u001b[43mattributes\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m3\u001b[39;49m\u001b[43m]\u001b[49m[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mexpected_mean\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m 19\u001b[0m \u001b[38;5;66;03m# the decision function\u001b[39;00m\n\u001b[0;32m 20\u001b[0m p_a \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mexp(beta \u001b[38;5;241m*\u001b[39m (w_a \u001b[38;5;241m-\u001b[39m l_a)) \u001b[38;5;241m/\u001b[39m (\n\u001b[0;32m 21\u001b[0m np\u001b[38;5;241m.\u001b[39mexp(beta \u001b[38;5;241m*\u001b[39m (w_a \u001b[38;5;241m-\u001b[39m l_a)) \u001b[38;5;241m+\u001b[39m np\u001b[38;5;241m.\u001b[39mexp(beta \u001b[38;5;241m*\u001b[39m (w_b \u001b[38;5;241m-\u001b[39m l_b))\n\u001b[0;32m 22\u001b[0m )\n",
"\u001b[1;31mKeyError\u001b[0m: 3"
]
}
Expand Down Expand Up @@ -448,6 +460,13 @@
" )\n",
"responses = jnp.asarray(responses) # vector of responses"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit e3994fc

Please sign in to comment.