adds step 4 exercise
This commit is contained in:
parent
5455d9be1d
commit
e96a56f177
1 changed files with 18 additions and 18 deletions
|
@ -10,7 +10,7 @@
|
|||
}
|
||||
},
|
||||
"source": [
|
||||
"# Break out the next step proposal\n",
|
||||
"# How can we break out the next step proposal?\n",
|
||||
"\n",
|
||||
"- We want a separate module for `next_step_proposals`, living in a separate file\n",
|
||||
" - a Gaussian one (it's the one currently in the Walker code), called `gaussian_next_step_proposal`\n",
|
||||
|
@ -102,27 +102,11 @@
|
|||
"plot_trajectory(trajectory, walker.context_map)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"nteract": {
|
||||
"transient": {
|
||||
"deleting": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
"# 2. Implement the changes in the code\n",
|
||||
"1. In a new module `next_step_proposals`, write two functions for two different next step proposals: a Gaussian one (it's the one currently in the Walker code) and a square one (you can find an example below)\n",
|
||||
"2. Modify the constructor of Walker to take a `next_step_proposal` function and a `next_step_proposal_arguments` dictionary as an input\n",
|
||||
"3. See if the dream code you wrote works with your implementation! (Don't forget to restart the kernel)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# What the square next step proposal could look like\n",
|
||||
"# What the square next step proposal could look like (info)\n",
|
||||
"\n",
|
||||
"This is an example of what the square next step proposal function could look like.\n",
|
||||
"\n",
|
||||
|
@ -175,6 +159,22 @@
|
|||
"plt.colorbar()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {
|
||||
"nteract": {
|
||||
"transient": {
|
||||
"deleting": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
"# 2. Implement the changes in the code (optional)\n",
|
||||
"1. In a new module `next_step_proposals`, write two functions for two different next step proposals: a Gaussian one (it's the one currently in the Walker code) and a square one (you can find an example below)\n",
|
||||
"2. Modify the constructor of Walker to take a `next_step_proposal` function and a `next_step_proposal_arguments` dictionary as an input\n",
|
||||
"3. See if the dream code you wrote works with your implementation! (Don't forget to restart the kernel)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue