From e3994fc0306156a53543bad3bb2e09b6c7a949fd Mon Sep 17 00:00:00 2001 From: Louie Date: Wed, 4 Dec 2024 15:29:06 +0100 Subject: [PATCH] Move notebook to docs/source/notebooks folder --- .../notebooks}/Latent_var_notebook.ipynb | 69 ++++++++++++------- 1 file changed, 44 insertions(+), 25 deletions(-) rename {pyhgf/model => docs/source/notebooks}/Latent_var_notebook.ipynb (99%) diff --git a/pyhgf/model/Latent_var_notebook.ipynb b/docs/source/notebooks/Latent_var_notebook.ipynb similarity index 99% rename from pyhgf/model/Latent_var_notebook.ipynb rename to docs/source/notebooks/Latent_var_notebook.ipynb index b7df6353d..659241c10 100644 --- a/pyhgf/model/Latent_var_notebook.ipynb +++ b/docs/source/notebooks/Latent_var_notebook.ipynb @@ -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?" ] }, { @@ -24,7 +24,7 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -45,9 +45,21 @@ }, { "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." @@ -55,7 +67,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -71,7 +83,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -122,10 +134,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 63, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -136,7 +148,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -154,7 +166,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -205,10 +217,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 69, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -219,7 +231,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -229,7 +241,7 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -249,7 +261,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -262,7 +274,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -272,7 +284,7 @@ }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -292,7 +304,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -310,7 +322,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -361,10 +373,10 @@ "\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 72, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -375,7 +387,7 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -386,7 +398,7 @@ }, { "cell_type": "code", - "execution_count": 81, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -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" ] } @@ -448,6 +460,13 @@ " )\n", "responses = jnp.asarray(responses) # vector of responses" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {