Fix execution counts and update policy array initialization in maze game notebooks

This commit is contained in:
2026-01-06 11:13:17 +01:00
parent 6eecdd6ab3
commit 0e65815e38
2 changed files with 52 additions and 52 deletions

View File

@@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "100d1e0d",
"metadata": {},
"outputs": [],
@@ -100,7 +100,7 @@
},
{
"cell_type": "code",
"execution_count": 74,
"execution_count": 2,
"id": "f91cda05",
"metadata": {},
"outputs": [],
@@ -128,7 +128,7 @@
},
{
"cell_type": "code",
"execution_count": 75,
"execution_count": 3,
"id": "564cb757-eefe-4be6-9b6f-bb77ace42a97",
"metadata": {},
"outputs": [
@@ -150,7 +150,7 @@
},
{
"cell_type": "code",
"execution_count": 76,
"execution_count": 4,
"id": "26c821d3-2362-4b60-8c77-3d09296d130d",
"metadata": {},
"outputs": [
@@ -200,7 +200,7 @@
},
{
"cell_type": "code",
"execution_count": 77,
"execution_count": 5,
"id": "7116044b-c134-43de-9f30-01ab62325300",
"metadata": {},
"outputs": [],
@@ -231,7 +231,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "a1258de4",
"metadata": {},
"outputs": [
@@ -292,7 +292,7 @@
},
{
"cell_type": "code",
"execution_count": 79,
"execution_count": 7,
"id": "68744dd6-7278-4c20-8b82-34212685352f",
"metadata": {},
"outputs": [
@@ -366,7 +366,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"id": "fc61ceef-217c-47f4-8eba-0353369210db",
"metadata": {},
"outputs": [
@@ -476,7 +476,7 @@
},
{
"cell_type": "code",
"execution_count": 81,
"execution_count": 9,
"id": "f7f0b8e4-1f48-4d03-9e5f-a47e59c3e827",
"metadata": {},
"outputs": [],
@@ -488,7 +488,7 @@
},
{
"cell_type": "code",
"execution_count": 82,
"execution_count": 10,
"id": "3773781c-a0cd-48db-967b-d4b432d17046",
"metadata": {},
"outputs": [
@@ -518,7 +518,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"id": "4b06da5e-bc63-48e5-a336-37bce952443d",
"metadata": {},
"outputs": [],
@@ -597,7 +597,7 @@
},
{
"cell_type": "code",
"execution_count": 84,
"execution_count": 12,
"id": "610253e7-f3f7-4a30-be3e-2ec5a1e2ed04",
"metadata": {},
"outputs": [],
@@ -628,7 +628,7 @@
},
{
"cell_type": "code",
"execution_count": 85,
"execution_count": 13,
"id": "7a51f242-fe4e-4e74-8a1f-a8df32b194b8",
"metadata": {},
"outputs": [],
@@ -656,7 +656,7 @@
},
{
"cell_type": "code",
"execution_count": 86,
"execution_count": 14,
"id": "49d54d1f-dc29-45b6-ad31-ad0e848f920d",
"metadata": {},
"outputs": [],
@@ -701,7 +701,7 @@
},
{
"cell_type": "code",
"execution_count": 87,
"execution_count": 15,
"id": "b9b7495a-c233-425c-99c0-5bddaf6c3225",
"metadata": {},
"outputs": [],
@@ -727,7 +727,7 @@
},
{
"cell_type": "code",
"execution_count": 88,
"execution_count": 16,
"id": "eca4c571-39c7-468b-af86-0bab9489415e",
"metadata": {},
"outputs": [],
@@ -758,7 +758,7 @@
},
{
"cell_type": "code",
"execution_count": 89,
"execution_count": 17,
"id": "2d03276b-e206-4d1f-9024-f6948ca61523",
"metadata": {},
"outputs": [],
@@ -821,7 +821,7 @@
},
{
"cell_type": "code",
"execution_count": 90,
"execution_count": 18,
"id": "341fe630-8f87-4773-84ad-92d3516e53e2",
"metadata": {},
"outputs": [
@@ -968,7 +968,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 19,
"id": "2fffe0b7",
"metadata": {},
"outputs": [],
@@ -1037,7 +1037,7 @@
},
{
"cell_type": "code",
"execution_count": 92,
"execution_count": 20,
"id": "b4a44e38",
"metadata": {},
"outputs": [
@@ -1066,7 +1066,7 @@
},
{
"cell_type": "code",
"execution_count": 93,
"execution_count": 21,
"id": "c5f559b2-452a-477c-a1fa-258b40805670",
"metadata": {},
"outputs": [
@@ -1110,7 +1110,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 22,
"id": "4c428327",
"metadata": {},
"outputs": [
@@ -1184,7 +1184,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 23,
"id": "c1ab67f0-bd5e-4ffe-b655-aec030401b78",
"metadata": {},
"outputs": [],
@@ -1269,7 +1269,7 @@
},
{
"cell_type": "code",
"execution_count": 96,
"execution_count": 24,
"id": "d452681c-c89c-41cc-95dc-df75993b0391",
"metadata": {},
"outputs": [
@@ -1298,7 +1298,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 25,
"id": "929707e6-3022-4d86-96cc-12f251f890a9",
"metadata": {},
"outputs": [
@@ -1324,7 +1324,7 @@
}
],
"source": [
"my_policy = np.ndarray(\n",
"my_policy = np.array(\n",
" [\n",
" A_RIGHT,\n",
" A_RIGHT,\n",
@@ -1403,7 +1403,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.12"
"version": "3.13.9"
}
},
"nbformat": 4,

View File

@@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 535,
"execution_count": 24,
"id": "100d1e0d",
"metadata": {},
"outputs": [],
@@ -49,7 +49,7 @@
},
{
"cell_type": "code",
"execution_count": 536,
"execution_count": 25,
"id": "f91cda05",
"metadata": {},
"outputs": [],
@@ -72,7 +72,7 @@
},
{
"cell_type": "code",
"execution_count": 537,
"execution_count": 26,
"id": "564cb757-eefe-4be6-9b6f-bb77ace42a97",
"metadata": {},
"outputs": [],
@@ -93,7 +93,7 @@
},
{
"cell_type": "code",
"execution_count": 538,
"execution_count": 27,
"id": "7116044b-c134-43de-9f30-01ab62325300",
"metadata": {},
"outputs": [],
@@ -116,7 +116,7 @@
},
{
"cell_type": "code",
"execution_count": 539,
"execution_count": 28,
"id": "a1258de4",
"metadata": {},
"outputs": [
@@ -170,7 +170,7 @@
},
{
"cell_type": "code",
"execution_count": 540,
"execution_count": 29,
"id": "fc61ceef-217c-47f4-8eba-0353369210db",
"metadata": {},
"outputs": [
@@ -250,7 +250,7 @@
},
{
"cell_type": "code",
"execution_count": 541,
"execution_count": 30,
"id": "f7f0b8e4-1f48-4d03-9e5f-a47e59c3e827",
"metadata": {},
"outputs": [],
@@ -262,7 +262,7 @@
},
{
"cell_type": "code",
"execution_count": 542,
"execution_count": 31,
"id": "4b06da5e-bc63-48e5-a336-37bce952443d",
"metadata": {},
"outputs": [],
@@ -330,7 +330,7 @@
},
{
"cell_type": "code",
"execution_count": 543,
"execution_count": 32,
"id": "610253e7-f3f7-4a30-be3e-2ec5a1e2ed04",
"metadata": {},
"outputs": [],
@@ -341,7 +341,7 @@
},
{
"cell_type": "code",
"execution_count": 544,
"execution_count": 33,
"id": "7a51f242-fe4e-4e74-8a1f-a8df32b194b8",
"metadata": {},
"outputs": [],
@@ -353,7 +353,7 @@
},
{
"cell_type": "code",
"execution_count": 545,
"execution_count": 34,
"id": "49d54d1f-dc29-45b6-ad31-ad0e848f920d",
"metadata": {},
"outputs": [],
@@ -366,7 +366,7 @@
},
{
"cell_type": "code",
"execution_count": 546,
"execution_count": 35,
"id": "b9b7495a-c233-425c-99c0-5bddaf6c3225",
"metadata": {},
"outputs": [],
@@ -382,7 +382,7 @@
},
{
"cell_type": "code",
"execution_count": 547,
"execution_count": 36,
"id": "eca4c571-39c7-468b-af86-0bab9489415e",
"metadata": {},
"outputs": [],
@@ -397,7 +397,7 @@
},
{
"cell_type": "code",
"execution_count": 548,
"execution_count": 37,
"id": "2d03276b-e206-4d1f-9024-f6948ca61523",
"metadata": {},
"outputs": [],
@@ -445,7 +445,7 @@
},
{
"cell_type": "code",
"execution_count": 549,
"execution_count": 38,
"id": "341fe630-8f87-4773-84ad-92d3516e53e2",
"metadata": {},
"outputs": [
@@ -492,7 +492,7 @@
},
{
"cell_type": "code",
"execution_count": 550,
"execution_count": 39,
"id": "2fffe0b7",
"metadata": {},
"outputs": [],
@@ -543,7 +543,7 @@
},
{
"cell_type": "code",
"execution_count": 551,
"execution_count": 40,
"id": "4c428327",
"metadata": {},
"outputs": [],
@@ -595,7 +595,7 @@
},
{
"cell_type": "code",
"execution_count": 552,
"execution_count": null,
"id": "c1ab67f0-bd5e-4ffe-b655-aec030401b78",
"metadata": {},
"outputs": [],
@@ -665,7 +665,7 @@
" ax.set_yticks(np.arange(-0.5, n_rows, 1))\n",
" ax.set_xticklabels([])\n",
" ax.set_yticklabels([])\n",
" ax.grid(True)\n",
" ax.grid(visible=True)\n",
" ax.set_title(title)\n",
" plt.show()"
]
@@ -680,7 +680,7 @@
},
{
"cell_type": "code",
"execution_count": 553,
"execution_count": 42,
"id": "ceb5dfe2",
"metadata": {},
"outputs": [
@@ -702,7 +702,7 @@
},
{
"cell_type": "code",
"execution_count": 554,
"execution_count": 43,
"id": "8f3e2ac2",
"metadata": {},
"outputs": [
@@ -729,7 +729,7 @@
},
{
"cell_type": "code",
"execution_count": 558,
"execution_count": 44,
"id": "cf45291e",
"metadata": {},
"outputs": [
@@ -761,7 +761,7 @@
},
{
"cell_type": "code",
"execution_count": 557,
"execution_count": 45,
"id": "5a82a3b7",
"metadata": {},
"outputs": [
@@ -787,7 +787,7 @@
}
],
"source": [
"my_policy = [\n",
"my_policy = np.array([\n",
" A_DOWN,\n",
" A_DOWN,\n",
" A_LEFT,\n",
@@ -850,7 +850,7 @@
" A_UP,\n",
" A_DOWN,\n",
" A_LEFT,\n",
"]\n",
"])\n",
"\n",
"V_my_policy = policy_evaluation(policy=my_policy, P=P, R=R, gamma=gamma)\n",
"\n",