Skip to content

Commit

Permalink
remove deterministic in predictive
Browse files Browse the repository at this point in the history
  • Loading branch information
fehiepsi committed Feb 15, 2024
1 parent ee25cb9 commit 812c303
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- name: Check out
uses: actions/checkout@v2
- name: Build and Deploy Nikola
working-directory: ./site
uses: getnikola/nikola-action@v4
with:
dry_run: false
working-directory: ./site
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
"# compute percentile interval of mean\n",
"A_seq = jnp.linspace(start=-3, stop=3.2, num=30)\n",
"post = m5_1.sample_posterior(random.PRNGKey(1), p5_1, sample_shape=(1000,))\n",
"post.pop(\"mu\")\n",
"post_pred = Predictive(m5_1.model, post)(random.PRNGKey(2), A=A_seq)\n",
"mu = post_pred[\"mu\"]\n",
"mu_mean = jnp.mean(mu, 0)\n",
Expand Down Expand Up @@ -551,6 +552,7 @@
"outputs": [],
"source": [
"post = m5_4.sample_posterior(random.PRNGKey(1), p5_4, sample_shape=(1000,))\n",
"post.pop(\"mu\")\n",
"post_pred = Predictive(m5_4.model, post)(random.PRNGKey(2), A=d.A.values)\n",
"mu = post_pred[\"mu\"]\n",
"mu_mean = jnp.mean(mu, 0)\n",
Expand All @@ -573,6 +575,7 @@
"# call predictive without specifying new data\n",
"# so it uses original data\n",
"post = m5_3.sample_posterior(random.PRNGKey(1), p5_3, (int(1e4),))\n",
"post.pop(\"mu\")\n",
"post_pred = Predictive(m5_3.model, post)(random.PRNGKey(2), M=d.M.values, A=d.A.values)\n",
"mu = post_pred[\"mu\"]\n",
"\n",
Expand Down Expand Up @@ -1394,6 +1397,7 @@
"source": [
"xseq = jnp.linspace(start=dcc.N.min() - 0.15, stop=dcc.N.max() + 0.15, num=30)\n",
"post = m5_5.sample_posterior(random.PRNGKey(1), p5_5, sample_shape=(1000,))\n",
"post.pop(\"mu\")\n",
"post_pred = Predictive(m5_5.model, post)(random.PRNGKey(2), N=xseq)\n",
"mu = post_pred[\"mu\"]\n",
"mu_mean = jnp.mean(mu, 0)\n",
Expand Down Expand Up @@ -1610,6 +1614,7 @@
"source": [
"xseq = jnp.linspace(start=dcc.N.min() - 0.15, stop=dcc.N.max() + 0.15, num=30)\n",
"post = m5_7.sample_posterior(random.PRNGKey(1), p5_7, sample_shape=(1000,))\n",
"post.pop(\"mu\")\n",
"post_pred = Predictive(m5_7.model, post)(random.PRNGKey(2), M=0, N=xseq)\n",
"mu = post_pred[\"mu\"]\n",
"mu_mean = jnp.mean(mu, 0)\n",
Expand Down

0 comments on commit 812c303

Please sign in to comment.