Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions Capítulo 6/6.3.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Exercise 6.3 From the results shown in the left graph of the random walk example it appears that the first episode results in a change in only V (A). What does this tell you about what happened on the first episode? Why was only the estimate for this one state changed? By exactly how much was it changed?"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"O estado terminal foi alcançado a partir do estado A, por esse motivo o valor de A foi o único modificado. Por exemplo, o valor $V(A)$ é alterado, pois:\n",
"\n",
"$$V(A) \\gets V(A) + \\alpha[R_{t+1} + \\gamma V(S_{t+1})- V(A)]$$\n",
"\n",
"$S_{t+1}$ tem valor 0, $R_{t+1}$ é igual a 0 e $\\gamma$ tem valor 1, então:\n",
"\n",
"$$V(A) \\gets 0.5 + 0.1[0 + 1\\cdot0-0.5]$$\n",
"$$V(A) \\gets 0.5 + 0.1[-0.5]$$\n",
"$$V(A) \\gets 0.5 -0.05$$\n",
"$$V(A) \\gets 0.45$$"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"O valor $V$ para qualquer outro estado será igual, menos o caso que o estado E realiza a movimentação para a direita em direção ao estado terminal com recompensa 1.\n",
"Por exemplo:\n",
"\n",
"$$V(S) \\gets V(S) + \\alpha[R_{t+1} + \\gamma V(S_{t+1})- V(S)]$$\n",
"\n",
"$$V(S) \\gets 0.5 + 0.1[0 + 1\\cdot0.5-0.5]$$\n",
"$$V(S) \\gets 0.5 + 0.1[0]$$\n",
"$$V(S) \\gets 0.5 $$\n",
"\n",
"Portanto, nessa primeira iteração, apenas $V(A)$ foi modificado."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}