Skip to content

Commit

Permalink
W2 D1, D2, D3, D5 postcourse bugfix (#535)
Browse files Browse the repository at this point in the history
* Closes #387 and fixes RGB -> C1C2C0

* Closes #395

* Process tutorial notebooks

* Closes #483

* Process tutorial notebooks

* Closes #406 and fixes colors

* Process tutorial notebooks

* Closes #404

* Process tutorial notebooks

* Closes #419

* Process tutorial notebooks

* Closes #410 T3 comments

* Closes  #410

* Process tutorial notebooks

* Partially addresses #435 for T1

* Process tutorial notebooks

* Created using Colaboratory

* Process tutorial notebooks

* Closes #457 #446, partially addresses #455

* Closes #456

* Process tutorial notebooks

* Closes #455

* Created using Colaboratory

* Closes #460

* Process tutorial notebooks

Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
JesseLivezey and actions-user authored Aug 25, 2020
1 parent ec1b9de commit 54eb773
Show file tree
Hide file tree
Showing 54 changed files with 905 additions and 893 deletions.
98 changes: 49 additions & 49 deletions tutorials/W2D1_BayesianStatistics/W2D1_Tutorial1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/master/tutorials/W2D1_BayesianStatistics/W2D1_Tutorial1.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
"<a href=\"https://colab.research.google.com/github/NeuromatchAcademy/course-content/blob/W2D1-postcourse-bugfix/tutorials/W2D1_BayesianStatistics/W2D1_Tutorial1.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
Expand Down Expand Up @@ -48,10 +48,10 @@
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 516
"height": 519
},
"colab_type": "code",
"outputId": "3fd0f192-d565-4140-f64c-7151d8ddcd44"
"outputId": "bccac551-e778-4f58-ea61-cdd93ffd4cde"
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -128,7 +128,7 @@
" px = np.zeros_like(x)\n",
"\n",
" fig, ax = plt.subplots()\n",
" ax.plot(x, px, '-', color='xkcd:green', LineWidth=2, label='Prior')\n",
" ax.plot(x, px, '-', color='C2', LineWidth=2, label='Prior')\n",
" ax.legend()\n",
" ax.set_ylabel('Probability')\n",
" ax.set_xlabel('Orientation (Degrees)')\n",
Expand Down Expand Up @@ -160,9 +160,9 @@
" if ax is None:\n",
" fig, ax = plt.subplots()\n",
"\n",
" ax.plot(x, likelihood, '-r', LineWidth=2, label='Auditory')\n",
" ax.plot(x, prior, '-b', LineWidth=2, label='Visual')\n",
" ax.plot(x, posterior_pointwise, '-g', LineWidth=2, label='Posterior')\n",
" ax.plot(x, likelihood, '-C1', LineWidth=2, label='Auditory')\n",
" ax.plot(x, prior, '-C0', LineWidth=2, label='Visual')\n",
" ax.plot(x, posterior_pointwise, '-C2', LineWidth=2, label='Posterior')\n",
" ax.legend()\n",
" ax.set_ylabel('Probability')\n",
" ax.set_xlabel('Orientation (Degrees)')\n",
Expand All @@ -187,7 +187,7 @@
" fig_w, fig_h = plt.rcParams.get('figure.figsize')\n",
" fig, ax = plt.subplots(nrows=2, ncols=1, figsize=(fig_w, 2 * fig_h))\n",
"\n",
" ax[0].plot(mu_visuals, max_posteriors, '-g', label='mean')\n",
" ax[0].plot(mu_visuals, max_posteriors, '-C2', label='mean')\n",
" ax[0].set_xlabel('Visual stimulus position')\n",
" ax[0].set_ylabel('Multiplied posterior mean')\n",
" ax[0].set_title('Sample output')\n",
Expand Down Expand Up @@ -215,7 +215,7 @@
" )\n",
" ax[0].set_title('Example combination')\n",
"\n",
" ax[1].plot(mu_visuals, posterior_modes, '-g', label='argmax')\n",
" ax[1].plot(mu_visuals, posterior_modes, '-C2', label='argmax')\n",
" ax[1].set_xlabel('Visual stimulus position\\n(Mean of blue dist. above)')\n",
" ax[1].set_ylabel('Posterior mode\\n(Peak of green dist. above)')\n",
" fig.tight_layout()"
Expand Down Expand Up @@ -302,10 +302,10 @@
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 329
"height": 332
},
"colab_type": "code",
"outputId": "a7a15fb4-3a92-4b07-a4de-3e39b5a496f1"
"outputId": "600f468b-7f03-45c2-a67f-c5af67121ba3"
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -362,10 +362,10 @@
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 516
"height": 519
},
"colab_type": "code",
"outputId": "1c125444-92a6-46c4-b527-a7217a542dfb"
"outputId": "f27d7154-1f82-4dd7-d21d-1d1ae4c9ae8c"
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -490,10 +490,10 @@
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 329
"height": 332
},
"colab_type": "code",
"outputId": "b92b5494-8d7f-4feb-ae55-d5320f7e9c6e"
"outputId": "d24f3579-18f5-4ccd-b2bb-7d078ad9c7f8"
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -562,28 +562,28 @@
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 424,
"height": 425,
"referenced_widgets": [
"7945823b088f41d9b2dd23cfaca5a02c",
"7638bc57394e4373bb83e8d65b58f706",
"71b90bfcba9b457f88eb2162b2576b22",
"b38f8a52957b48b0919f92e7e83ee9b4",
"c58fe72ab22745f69f0da021ed457829",
"10b1d18631b4430897bacbf3e26b4c25",
"4ba723ad9fc545b0a07806681b24f511",
"25610ba7b6a24287aa02456bd5432a21",
"087400670c274d9e82bce000efeed833",
"68d12614e0f44258894f25aae6af04dc",
"45187d7588b44adfa692be8c3f80521b",
"be26667a7c8f4ca8aef0e4120ac64b7c",
"308a5f1617bf47acb759ae3864f69813",
"6f9e8e29467f4c3f94a98c2baef3e5ec",
"e9f5571dfd5643fa9d5be9fb5e4ca47b",
"5928733140aa4fb7a36d4367b16d613d"
"1ff53dec265843afb986bf03530771ae",
"05a3296faf284e43be80f3f46d171261",
"19a5041ddd174440a8a6c678be876f0c",
"fdc140da3de049739a78aca60ebede0e",
"4b472618a4d7409b92723f2219dfb72d",
"0b84e97b9e51464d9b0b421aff355edb",
"ce8d924b5f50488fb86eaa5c875d3d31",
"3a5f7bd213f442e5b3af1c8e84a4520b",
"e46c2185e8404991a3912fe9b5382d61",
"dd4fc70382994a4fa5295b91af329218",
"7dc8a2b2d6f244b799a7f8cf14a26e58",
"d4c0bfac0af7471999a5c0eba3094871",
"c578a633433343718e1a5fc4d1763cd5",
"5e28d4f613bd4adeb2fc4264323c748d",
"a5352563108a4e1cbc498b5372e69a38",
"fc0a0a90e46f44ac82f71ab5b924f84d"
]
},
"colab_type": "code",
"outputId": "24fc0ae7-e35d-4345-ccaa-471d9746795c"
"outputId": "b8ba4c5f-cbe9-4122-e2e0-5406af4bd802"
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -635,10 +635,10 @@
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 516
"height": 519
},
"colab_type": "code",
"outputId": "51c73791-4291-443b-bf31-d71d74059592"
"outputId": "85d7fbcc-3e73-4fa8-efcf-fd9163f1cad0"
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -729,12 +729,12 @@
" mus_by_integration.append(mu_integrated)\n",
" mus_analytical.append(mu_analytical)\n",
"\n",
" return mu_visuals, mus_by_integration, mus_analytical\n",
" return mu_visuals, mus_analytical, mus_by_integration\n",
"\n",
"\n",
"# Uncomment the lines below to visualize your results\n",
"# mu_visuals, mu_computational, mu_analytical = compare_computational_analytical_means()\n",
"# plot_visual(mu_visuals, mu_computational, mu_analytical)"
"# mu_visuals, mu_analytical, mu_computational = compare_computational_analytical_means()\n",
"# plot_visual(mu_visuals, mu_analytical, mu_computational)"
]
},
{
Expand All @@ -744,10 +744,10 @@
"cellView": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 616
"height": 620
},
"colab_type": "code",
"outputId": "78480dbf-d355-403e-cd82-07197ccb29aa"
"outputId": "04dc281e-c2dc-4664-a097-e3162905e94e"
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -790,14 +790,14 @@
" mus_by_integration.append(mu_integrated)\n",
" mus_analytical.append(mu_analytical)\n",
"\n",
" return mu_visuals, mus_by_integration, mus_analytical\n",
" return mu_visuals, mus_analytical, mus_by_integration\n",
"\n",
"\n",
"# Uncomment the lines below to visualize your results\n",
"mu_visuals, mu_computational, mu_analytical = compare_computational_analytical_means()\n",
"mu_visuals, mu_analytical, mu_computational = compare_computational_analytical_means()\n",
"\n",
"with plt.xkcd():\n",
" plot_visual(mu_visuals, mu_computational, mu_analytical)"
" plot_visual(mu_visuals, mu_analytical, mu_computational)"
]
},
{
Expand All @@ -819,10 +819,10 @@
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 516
"height": 519
},
"colab_type": "code",
"outputId": "9b56907a-807d-49e8-be3e-bd050b4fe1f5"
"outputId": "b050d942-8c2d-4d5d-fc1c-b3f478da343e"
},
"outputs": [],
"source": [
Expand Down Expand Up @@ -894,7 +894,7 @@
" ## Finish this function so that it returns the location of the mode\n",
" #\n",
" # Comment out the line below to test out your solution\n",
" raise NotImplementedError(\"Please implement the bimodal prior\")\n",
" raise NotImplementedError(\"Please implement the posterior mode\")\n",
" ################################################################################\n",
" mode = ...\n",
"\n",
Expand Down Expand Up @@ -943,10 +943,10 @@
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 616
"height": 620
},
"colab_type": "code",
"outputId": "868e2a1d-0a1f-4e60-e81d-7f100f4504d1"
"outputId": "1652973d-2186-4666-8a9d-f4ac766eaa7a"
},
"outputs": [],
"source": [
Expand All @@ -970,7 +970,7 @@
" ## Finish this function so that it returns the location of the mode\n",
" #\n",
" # Comment out the line below to test out your solution\n",
" #raise NotImplementedError(\"Please implement the bimodal prior\")\n",
" #raise NotImplementedError(\"Please implement the posterior mode\")\n",
" ################################################################################\n",
" mode = x[np.argmax(posterior)]\n",
"\n",
Expand Down
Loading

0 comments on commit 54eb773

Please sign in to comment.