Skip to content

Commit

Permalink
Make sure to install docs requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
AnesBenmerzoug committed May 6, 2024
1 parent 582f394 commit a77692f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ WORKDIR $CODE_DIR

COPY --chown=${NB_UID}:${NB_GID} poetry.lock pyproject.toml ./

RUN poetry export --no-interaction --no-ansi --without=dev -f requirements.txt --output requirements.txt \
RUN poetry export --no-interaction --no-ansi --with=docs --without=dev -f requirements.txt --output requirements.txt \
&& pip install --no-cache-dir --requirement requirements.txt

COPY --chown=${NB_UID}:${NB_GID} src/ src/
Expand Down
26 changes: 26 additions & 0 deletions notebooks/nb_20_dynamic_programming.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,32 @@
"plot_all_paths_graph(G, show_solution=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Value Iteration\n",
"\n",
"Another way to compute the optimal cost-to-go for all states that is also applicable in stochastic problems\n",
"is the **Value Iteration** algorithm:\n",
"\n",
"$$\n",
"\\begin{array}{l}\n",
" \\textbf{Input}:\\ \\text{MDP}\\ M = \\langle S, s_0, A, P_a(s' \\mid s), r(s,a,s')\\rangle\\\\\n",
" \\textbf{Output}:\\ \\text{Value function}\\ V\\\\[2mm]\n",
" \\text{Set}\\ V\\ \\text{to arbitrary value function; e.g., }\\ V(s) = 0\\ \\text{for all}\\ s\\\\[2mm]\n",
" \\text{repeat}\\ \\\\\n",
" \\quad\\quad \\Delta \\leftarrow 0 \\\\\n",
" \\quad\\quad \\text{foreach}\\ s \\in S \\\\\n",
" \\quad\\quad\\quad\\quad \\underbrace{V'(s) \\leftarrow \\max_{a \\in A(s)} \\sum_{s' \\in S} P_a(s' \\mid s)\\ [r(s,a,s') + \n",
" \\gamma\\ V(s') ]}_{\\text{Bellman equation}} \\\\\n",
" \\quad\\quad\\quad\\quad \\Delta \\leftarrow \\max(\\Delta, |V'(s) - V(s)|) \\\\\n",
" \\quad\\quad V \\leftarrow V' \\\\\n",
" \\text{until}\\ \\Delta \\leq \\theta \n",
"\\end{array}\n",
"$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit a77692f

Please sign in to comment.