You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

361 lines
94 KiB

3 months ago
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "markdown",
  5. "metadata": {},
  6. "source": [
  7. "## Example usage of Tempestpy"
  8. ]
  9. },
  10. {
  11. "cell_type": "code",
  12. "execution_count": 1,
  13. "metadata": {
  14. "vscode": {
  15. "languageId": "plaintext"
  16. }
  17. },
  18. "outputs": [
  19. {
  20. "name": "stdout",
  21. "output_type": "stream",
  22. "text": [
  23. "pygame 2.6.0 (SDL 2.28.4, Python 3.10.12)\n",
  24. "Hello from the pygame community. https://www.pygame.org/contribute.html\n"
  25. ]
  26. },
  27. {
  28. "name": "stderr",
  29. "output_type": "stream",
  30. "text": [
  31. "2024-09-23 08:58:51.801230: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:485] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n",
  32. "2024-09-23 08:58:51.816264: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:8454] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n",
  33. "2024-09-23 08:58:51.820526: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1452] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n",
  34. "2024-09-23 08:58:51.831659: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
  35. "To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
  36. "2024-09-23 08:58:52.758922: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n",
  37. "error: XDG_RUNTIME_DIR not set in the environment.\n"
  38. ]
  39. }
  40. ],
  41. "source": [
  42. "from sb3_contrib import MaskablePPO\n",
  43. "from sb3_contrib.common.wrappers import ActionMasker\n",
  44. "from stable_baselines3.common.logger import Logger, CSVOutputFormat, TensorBoardOutputFormat, HumanOutputFormat\n",
  45. "\n",
  46. "import gymnasium as gym\n",
  47. "\n",
  48. "from minigrid.core.actions import Actions\n",
  49. "from minigrid.core.constants import TILE_PIXELS\n",
  50. "from minigrid.wrappers import RGBImgObsWrapper, ImgObsWrapper\n",
  51. "\n",
  52. "import tempfile, datetime, shutil\n",
  53. "\n",
  54. "import time\n",
  55. "import os\n",
  56. "\n",
  57. "from utils import MiniGridShieldHandler, create_log_dir, ShieldingConfig, MiniWrapper, expname, shield_needed, shielded_evaluation, create_shield_overlay_image\n",
  58. "from sb3utils import MiniGridSbShieldingWrapper, parse_sb3_arguments, ImageRecorderCallback, InfoCallback\n",
  59. "\n",
  60. "import os, sys\n",
  61. "from copy import deepcopy\n",
  62. "\n",
  63. "from PIL import Image"
  64. ]
  65. },
  66. {
  67. "cell_type": "code",
  68. "execution_count": null,
  69. "metadata": {
  70. "vscode": {
  71. "languageId": "plaintext"
  72. }
  73. },
  74. "outputs": [
  75. {
  76. "name": "stdout",
  77. "output_type": "stream",
  78. "text": [
  79. "Starting the training\n"
  80. ]
  81. },
  82. {
  83. "data": {
  84. "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAGAAYADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJ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L3ZVnKU5gTIEAgE3hks0OrdV0PHX/o4C2gzr8jxmcHZ3uIz0uf/QPKR30EKwHNCRDIBQQot7MkQKAUEKAS0JwAgVxAgHI7SwIESgEBKgHNCRDIBQQot7MkQKAUEKAS0JwAgVxAgHI7SwIESgEBKgHNCRD
  86. "text/plain": [
  87. "<PIL.Image.Image image mode=RGB size=384x384>"
  88. ]
  89. },
  90. "metadata": {},
  91. "output_type": "display_data"
  92. },
  93. {
  94. "name": "stdout",
  95. "output_type": "stream",
  96. "text": [
  97. "\n",
  98. "\n",
  99. "Computing new shield\n",
  100. "LOG: Starting with explicit model creation...\n",
  101. "Elapsed time is 0.0021867752075195312 seconds.\n",
  102. "LOG: Starting with model checking...\n",
  103. "Elapsed time is 0.00021076202392578125 seconds.\n",
  104. "LOG: Starting to translate shield...\n",
  105. "Elapsed time is 0.013784170150756836 seconds.\n"
  106. ]
  107. },
  108. {
  109. "data": {
  110. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAeBElEQVR4Ae3cz3EjSZLFYXCNMvC0exgtOErgtitBKrB9pACUAlJAitJi7q0EB07rmGYlmUDkv/D3Mn40a8sCkBme+YXTXxWru5+GYfg48YUAAggg0J3Af3X3xDwwAggggMCnAAFAIyCAAAKdChAAnW48j40AAggQAPQAAggg0KkAAdDpxvPYCCCAAAFADyCAAAKdChAAnW48j40AAggQAPQAAggg0KkAAdDpxvPYCCCAAAFADyCAAAKdChAAnW48j40AAggQAPQAAggg0KkAAdDpxvPYCCCAAAFADyCAAAKdChAAnW48j40AAggQAPQAAggg0KkAAdDpxvPYCCCAAAFADyCAAAKdChAAnW48j40AAggQAPQAAggg0KkAAdDpxvPYCCCAAAFADyCAAAKdChAAnW48j40AAggQAPQAAggg0KkAAdDpxvPYCCCAAAFADyCAAAKdChAAnW48j40AAggQAPQAAggg0KkAAdDpxvPYCCCAAAFADyCAAAKdChAAnW48j40AAgg8ZxO8Xa/Zt0B9BBDoVODPf/yZ+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k4CznPIOgCiSZzxnZqce0UAge8C7vPHPgBev+8J7yCAAAJNBNznj3UAuOM36VCKIIDArgLOc8g2AJzRd+1GFkcAgeYCrvPIMgBcsZt3JQURQKCZgONcsgsAR+RmHUghBBBIFXCbT1YB4Iab2okURwCBFAGnOWUTAE6oKV1HUQQQkBFwmVcWAeCCKdN93AgCCKQLOMw
  111. "text/plain": [
  112. "<PIL.Image.Image image mode=RGBA size=384x384>"
  113. ]
  114. },
  115. "metadata": {},
  116. "output_type": "display_data"
  117. },
  118. {
  119. "name": "stdout",
  120. "output_type": "stream",
  121. "text": [
  122. "The shield for shield_value = 0.9\n",
  123. "\n",
  124. "\n",
  125. "Computing new shield\n",
  126. "LOG: Starting with explicit model creation...\n",
  127. "Elapsed time is 0.0031201839447021484 seconds.\n",
  128. "LOG: Starting with model checking...\n",
  129. "Elapsed time is 0.0002391338348388672 seconds.\n",
  130. "LOG: Starting to translate shield...\n",
  131. "Elapsed time is 0.013186454772949219 seconds.\n"
  132. ]
  133. },
  134. {
  135. "data": {
  136. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAeCElEQVR4Ae3dzXUjO5KGYWqObNBqZtFeqJ3gbsaCdGDuUgbIClpBK8qL2V8nNAz1xW1VSkki/xDfl3h1TnWKSSQCeBCMqFJVdz8Nw/Bx4gsBBBBAoDuB/+hux2wYAQQQQOBTgAZAIiCAAAKdCtAAOj14to0AAgjQAMgBBBBAoFMBGkCnB8+2EUAAARoAOYAAAgh0KkAD6PTg2TYCCCBAAyAHEEAAgU4FaACdHjzbRgABBGgA5AACCCDQqQANoNODZ9sIIIAADYAcQAABBDoVoAF0evBsGwEEEKABkAMIIIBApwI0gE4Pnm0jgAACNAByAAEEEOhUgAbQ6cGzbQQQQIAGQA4ggAACnQrQADo9eLaNAAII0ADIAQQQQKBTARpApwfPthFAAAEaADmAAAIIdCpAA+j04Nk2AgggQAMgBxBAAIFOBWgAnR4820YAAQRoAOQAAggg0KkADa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R4hmdkDAgjUC7jVJ7sGEEfhhlyfPoxEAAFXAce6ZNkAIkEcsV0Tm3UjgMB9Add6ZNsA4jhc0e+nEu8igICTgHMdsm4AkSTO+E5JzloRQOC7gHv9sW8Ar9/PhDsIIIBAEwH3+mPdANzxm2QoQRBAYFcB5zpk2wCc0XfNRiZHAIHmAq71yLIBuGI3z0oCIoBAMwHHumTXAByRm2UggRBAIFXArT5ZNQA33NRMJDgCCKQIONUpmwbghJqSdQRFAAEZAZd6ZdEAXDBlso+FIIBAuoB
  137. "text/plain": [
  138. "<PIL.Image.Image image mode=RGBA size=384x384>"
  139. ]
  140. },
  141. "metadata": {},
  142. "output_type": "display_data"
  143. },
  144. {
  145. "name": "stdout",
  146. "output_type": "stream",
  147. "text": [
  148. "The shield for shield_value = 0.99\n",
  149. "\n",
  150. "\n",
  151. "Computing new shield\n",
  152. "LOG: Starting with explicit model creation...\n",
  153. "Elapsed time is 0.0027511119842529297 seconds.\n",
  154. "LOG: Starting with model checking...\n",
  155. "Elapsed time is 0.0002467632293701172 seconds.\n",
  156. "LOG: Starting to translate shield...\n",
  157. "Elapsed time is 0.014038324356079102 seconds.\n"
  158. ]
  159. },
  160. {
  161. "data": {
  162. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAd0UlEQVR4Ae3dT3LjWnLFYcqh8MgjO4LRjmgPehfyJjjzDrCBfkMtQKvgKriGHmgFPe3524TMVLzbrYIEEH9vnoP7U8QziiRwE/huKk+Vqmw/dV33ceILAQQQQKA5gX9r7ol5YAQQQACBTwECgEZAAAEEGhUgABrdeB4bAQQQIADoAQQQQKBRAQKg0Y3nsRFAAAECgB5AAAEEGhUgABrdeB4bAQQQIADoAQQQQKBRAQKg0Y3nsRFAAAECgB5AAAEEGhUgABrdeB4bAQQQIADoAQQQQKBRAQKg0Y3nsRFAAAECgB5AAAEEGhUgABrdeB4bAQQQIADoAQQQQKBRAQKg0Y3nsRFAAAECgB5AAAEEGhUgABrde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80w2AIJfFW3b1mA1BBA4soDyHJMOgGgKZbwjNy3PhgAC6wXU55d8AMQWqCOubxNWQACBowk4zC2LAIjGcMA8WgPzPAggsEzAZV7ZBEBsgwvqspbhKgQQOIKA05yyCoBoDifcIzQzz4AAAtMF3OaTXQDEVrghT28fzkQAAVcBx7lkGQDRII7Yro3NfSOAwLiA6zyyDYDYDlf08VbiUwQQcBJwnkPWARBN4ozv1OTcKwIIfBdwnz/2AfDyfU94BwEEEKgi4D5/rAPAHb9Kh1IEAQR2FXCeQ7YB4Iy+azeyOAIIVBdwnUeWAeCKXb0rKYgAAtUEHOeSXQA4IlfrQAohgECqgNt8sgoAN9zUTqQ4AgikCDjNKZsAcEJN6TqKIoCAjIDLvLIIABdMme7
  163. "text/plain": [
  164. "<PIL.Image.Image image mode=RGBA size=384x384>"
  165. ]
  166. },
  167. "metadata": {},
  168. "output_type": "display_data"
  169. },
  170. {
  171. "name": "stdout",
  172. "output_type": "stream",
  173. "text": [
  174. "The shield for shield_value = 0.999\n",
  175. "\n",
  176. "\n",
  177. "Computing new shield\n",
  178. "LOG: Starting with explicit model creation...\n",
  179. "Elapsed time is 0.0026831626892089844 seconds.\n",
  180. "LOG: Starting with model checking...\n",
  181. "Elapsed time is 0.00027632713317871094 seconds.\n",
  182. "LOG: Starting to translate shield...\n",
  183. "Elapsed time is 0.013882875442504883 seconds.\n"
  184. ]
  185. },
  186. {
  187. "data": {
  188. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAeG0lEQVR4Ae3bP3IsW1bF4RKhMZQFRPQsBIMoD3oCOQHA0wBkNgygRgBeTYKLhdUWRkcTREA8AwsLR51b0ee2bupmVf49e608v4pQ1FVV1tknv7O117t67z11Xfd+4oEAAggg0JzAnzV3x9wwAggggMCHAAFAIyCAAAKNChAAjR48t40AAggQAPQAAggg0KgAAdDowXPbCCCAAAFADyCAAAKNChAAjR48t40AAggQAPQAAggg0KgAAdDowXPbCCCAAAFADyCAAAKNChAAjR48t40AAggQAPQAAggg0KgAAdDowXPbCCCAAAFADyCAAAKNChAAjR48t40AAggQAPQAAggg0KgAAdDowXPbCCCAAAFADyCAAAKNChAAjR48t40AAggQAPQAAggg0KgAAdDowXPbCCCAAAFADyCAAAKNChAAjR48t40AAggQAPQAAggg0KgAAdDowXPbCCCAAAFADyCAAAKNChAAjR48t40AAggQAPQAAggg0KgAAdDowXPbCCCAAAFADyCAAAKNChAAjR48t40AAgg8ZxO83m7ZW6A+Agg0KvDLr35JvfPz786nt8slbQ/pARB3/ssveYdw7bpTd72mHQD18af/8n7+Tr9K+9GXKNz0r4Be/ngE5bn2iZS65Zn6dQWKe3muW/10KnXLM/XrCmS5173L+9WaDYDh4Q+/v8+2/t1hveH36yvcX2FYb/j9/U+vf3dYb/j9+gr3VxjWG35//9Pr3x3WG36/vsL9FYb1ht/f//T6d4f1ht+vr3B/hdr17u8m790mA2Ds8Mde3/p4xuqMvU79bQXGnMde37b6n/7Jf7gu9Yci+3xfy3mf3W+7anMB8OjwH72/lv/R+o/ep/46gUe+j95fV318+Jd1qV8k9nne23efXe+3alMBMPXwp14391imrjv1OurPE5jqOvW6edUfD/+yHvWLxLbPe7luu8u6qzUTAHMPf+71j45t7npzr6f+fYG5nnOvv199+vAv61C/SGzzvLXnNrvKX6WJAFh6+Es/NzzWpess/Rz1fxRY6rj0cz9Wnz/8y+epXyTWPW/luG4Xmp8+fACsPXw+v65x8cNvjUB2/6zZu8NnDx0Aa5unHODSdZZ+rtQtz0vXWfq5Urc8L11n6edK3fK8dJ2lnyt1y/PSdZZ+rtQtz0vXWfq5Urc8L11n6edK3fK8dJ2lnyt1W3g+bABsffhz15t7/aNmm7ve3Oupf19grufc6+9Xn/9rJOo/EuX9EDhkAGzd/KVVpq479bqy7tTnqetOvW5q3XLd1HWnXlfWnfo8dd2p102tW66buu7U68q6U5+nrjv1uql1y3VT1516XVl36vPUdadeN7Xuka87XADsffiP1n/0/tpmerT+o/epv07gke+j99dVf/w3Ae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AFAQRaFFCac1IBEM2ghNNic3LPCCCwn4DafJMLgKBXQ9qvHVgZAQRaEVCca5IBEA2hiNVKo3KfCCCwrYDqPJMNgOBXRdu2NVgNAQSOLKA8x6QDIJpCGe/ITcu9IYDAegH1+SUfAHEE6ojr24QVEEDgaAIOc8siAKIxHDCP1sDcDwIILBNwmVc2ARDH4IK6rGX4FAIIHEHAaU5ZBUA0hxPuEZqZe0AAgekCbvPJLgDiKNyQp7cPVyKAgKuA41yyDIBoEEds18Zm3wggcF/AdR7ZBkAchyv6/VbiXQQQcBJwnkPWARBN4ozv1OTsFQEEvgq4zx/7AHj5eia8ggACCFQRcJ8/1gHgjl+lQymCAAK7CjjPIdsAcEbftRtZHAEEqgu4ziPLAHDFrt6VFEQAgWoCjnPJLgAckat1IIUQQCBVwG0+WQWAG25qJ1IcAQRSBJzmlE0AOKGmdB1
  189. "text/plain": [
  190. "<PIL.Image.Image image mode=RGBA size=384x384>"
  191. ]
  192. },
  193. "metadata": {},
  194. "output_type": "display_data"
  195. },
  196. {
  197. "name": "stdout",
  198. "output_type": "stream",
  199. "text": [
  200. "The shield for shield_value = 0.9999\n",
  201. "\n",
  202. "\n",
  203. "Computing new shield\n",
  204. "LOG: Starting with explicit model creation...\n",
  205. "Elapsed time is 0.002956867218017578 seconds.\n",
  206. "LOG: Starting with model checking...\n",
  207. "Elapsed time is 0.00025081634521484375 seconds.\n",
  208. "LOG: Starting to translate shield...\n",
  209. "Elapsed time is 0.014654159545898438 seconds.\n"
  210. ]
  211. },
  212. {
  213. "data": {
  214. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAd+klEQVR4Ae3cz3EryXLFYVBBG7B/XlwrYEVbQQO4lByABdIOToheaCGtxokrJGPqPd4mG+i/ledU/W7ECwyA7srqr5J5ZjgjvQzD8PvEHwQQQACB7gT+rbsn5oERQAABBD4FCAAaAQEEEOhUgADo9OB5bAQQQIAAoAcQQACBTgUIgE4PnsdGAAEECAB6AAEEEOhUgADo9OB5bAQQQIAAoAcQQACBTgUIgE4PnsdGAAEECAB6AAEEEOhUgADo9OB5bAQQQIAAoAcQQACBTgUIgE4PnsdGAAEECAB6AAEEEOhUgADo9OB5bAQQQIAAoAcQQACBTgUIgE4PnsdGAAEECAB6AAEEEOhUgADo9OB5bAQQQIAAoAcQQACBTgUIgE4PnsdGAAEECAB6AAEEEOhUgADo9OB5bAQQQIAAoAcQQACBTgUIgE4PnsdGAAEECAB6AAEEEOhUgADo9OB5bAQQQIAAoAcQQACBTgUIgE4PnsdGAAEECAB6AAEEEOhUgADo9OB5bAQQQOA1m+DtdsveAvURQKBTgb/+8Vfqk5//53x6v1zS9pAeAPHkf/2VdwjXYTgN12vaAVAff/ov7+fv9I+0H32Jwl3/CujX30dQXmufSKlbXqlfV6C4l9e61U+nUre8Ur+uQJZ73ad8XK3bABgf/vj9Y7bt347rjd9vr/B4hXG98fvHd2//dlxv/H57hccrjOuN3z++e/u343rj99srPF5hXG/8/vHd278d1xu/317h8Qq16z3eTd63XQbA1OFPfb738UzVmfqc+vsKTDlPfb5v9X/9nf94XeqPRY55X8v5mN3vu2p3AfDs8J99v5X/2frPvqf+NoFnvs++31Z9eviXdalfJI55Pdr3mF0ft2pXATD38Odet/RY5q479zrqLxOY6zr3umXVnw//sh71i8S+r0e57rvLuqt1EwBLD3/p9c+Obel6S6+n/mOBpZ5Lr39cff7wL+tQv0js87q35z67yl+liwBYe/hr7xsf69p11t5H/T8F1jquve/P6suHf7mf+kVi2+tejtt2oXl38wGw9fC5f1vj4offFoHs/tmyd4d7mw6Arc1TDnDtOmvvK3XL69p11t5X6pbXteusva/ULa9r11l7X6lbXteus/a+Ure8rl1n7X2lbnldu87a+0rd8rp2nbX3lbo9vDYbAHsf/tL1ll7/rNmWrrf0euo/FljqufT6x9WX/xqJ+s9E+T4EmgyAvZu/tMrcdedeV9ad+zp33bnXza1brpu77tzryrpzX+euO/e6uXXLdXPXnXtdWXfu69x15143t265bu66c68r6859nbvu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j3ADxd7/Wz/lAff/qvz5+/jxg653PW6PmsK/MroE+MVAqKI4AAAnUEVOadTAAEuwpKnRagCgII9CigNOekAiCaQQmnx+bkmRFA4DgBtfkmFwBBr4Z0XDuwMgII9CKgONckAyAaQhGrl0blORFAYF8B1XkmGwDBr4q2b2uwGgIItCygPMekAyCaQhmv5abl2RBAYLuA+vySD4A4AnXE7W3CCggg0JqAw9yyCIBoDAfM1hqY50EAgXUCLvPKJgDiGFxQ17UMdyGAQAsCTnPKKgCiOZxwW2hmngEBBOYLuM0nuwCIo3BDnt8+XIkAAq4CjnPJMgCiQRyxXRubfSOAwGMB13lkGwBxHK7oj1uJbxFAwEnAeQ5ZB0A0iTO+U5OzVwQQ+C7gPn/sA+DX9zPhEwQQQKCKgPv8sQ4Ad/wqHUoRBBA4VMB5DtkGgDP6od3I4gggUF3AdR5ZBoArdvWupCACCFQTcJxLdgHgiFytAymEAAKpAm7zySoA3HBTO5HiCCCQIuA0p2wCwAk1pesoigACMgIu88oiAFwwZbqPjSCAQLq
  215. "text/plain": [
  216. "<PIL.Image.Image image mode=RGBA size=384x384>"
  217. ]
  218. },
  219. "metadata": {},
  220. "output_type": "display_data"
  221. },
  222. {
  223. "name": "stdout",
  224. "output_type": "stream",
  225. "text": [
  226. "The shield for shield_value = 1.0\n"
  227. ]
  228. },
  229. {
  230. "data": {
  231. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAeC0lEQVR4Ae3czXXkTHKF4aIObaj9eNFWlBWwggZwKTlQFmh25YTohRbS6nOiVUFNzrBB4h/IuBf58pw5YFUBGcCTwbj9sVt66bru94UvBBBAAIHmBP6tuSfmgRFAAAEEPgUIABoBAQQQaFSAAGh043lsBBBAgACgBxBAAIFGBQiARjeex0YAAQQIAHoAAQQQaFSAAGh043lsBBBAgACgBxBAAIFGBQiARjeex0YAAQQIAHoAAQQQaFSAAGh043lsBBBAgACgBxBAAIFGBQiARjeex0YAAQQIAHoAAQQQaFSA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yAaAhFrFYaledEAIF9BVTnmWwABL8q2r6twWoIIHBmAeU5Jh0A0RTKeGduWp4NAQS2C6jPL/kAiC1QR9zeJqyAAAJnE3CYWxYBEI3hgHm2BuZ5EEBgnYDLvLIJgNgGF9R1LcNVCCBwBgGnOWUVANEcTrhnaGaeAQEE5gu4zSe7AIitcEOe3z6ciQACrgKOc8kyAKJBHLFdG5v7RgCBcQHXeWQbALEdrujjrcSnCCDgJOA8h6wDIJrEGd+pyblXBBD4LuA+f+wD4Nf3PeEdBBBAoIqA+/yxDgB3/CodShEEEDhUwHkO2QaAM/qh3cjiCCBQXcB1HlkGgCt29a6kIAIIVBNwnEt2AeCIXK0DKYQAAqkCbvPJKgDccFM7keIIIJAi4DSnbALACTWl6yiKAAIyAi7zyiIAXDBluo8bQQCBdAGHuSU
  232. "text/plain": [
  233. "<PIL.Image.Image image mode=RGBA size=384x384>"
  234. ]
  235. },
  236. "metadata": {},
  237. "output_type": "display_data"
  238. },
  239. {
  240. "name": "stdout",
  241. "output_type": "stream",
  242. "text": [
  243. "Using cpu device\n",
  244. "Wrapping the env with a `Monitor` wrapper\n",
  245. "Wrapping the env in a DummyVecEnv.\n",
  246. "Wrapping the env in a VecTransposeImage.\n",
  247. "-----------------------------------\n",
  248. "| info/ | |\n",
  249. "| no_shield_action | 0 |\n",
  250. "| sum_opened_door | 0 |\n",
  251. "| sum_picked_up | 0 |\n",
  252. "| sum_ran_into_lava | 0 |\n",
  253. "| sum_reached_goal | 5 |\n",
  254. "| rollout/ | |\n",
  255. "| ep_len_mean | 146 |\n",
  256. "| ep_rew_mean | 0.357 |\n",
  257. "| time/ | |\n",
  258. "| fps | 246 |\n",
  259. "| iterations | 1 |\n",
  260. "| time_elapsed | 8 |\n",
  261. "| total_timesteps | 2048 |\n",
  262. "-----------------------------------\n"
  263. ]
  264. }
  265. ],
  266. "source": [
  267. "GRID_TO_PRISM_BINARY=os.getenv(\"M2P_BINARY\")\n",
  268. "\n",
  269. "def mask_fn(env: gym.Env):\n",
  270. " return env.create_action_mask()\n",
  271. "\n",
  272. "def nomask_fn(env: gym.Env):\n",
  273. " return [1.0] * 7\n",
  274. "\n",
  275. "def main():\n",
  276. " # Edit 'environments/Minigrid/minigrid/envs/GSW_Playground.py' to alter the environment\n",
  277. " env = \"MiniGrid-GSW-v0\"\n",
  278. "\n",
  279. " # TODO Change the safety specification\n",
  280. " formula = \"Pmax=? [G true]\"\n",
  281. " value_for_training = 1.0\n",
  282. " shield_comparison = \"absolute\"\n",
  283. " shielding = ShieldingConfig.Training\n",
  284. " \n",
  285. " logger = Logger(\"/tmp\", output_formats=[HumanOutputFormat(sys.stdout)])\n",
  286. " \n",
  287. "\n",
  288. " env = gym.make(env, render_mode=\"rgb_array\")\n",
  289. " image_env = RGBImgObsWrapper(env, TILE_PIXELS)\n",
  290. " env = RGBImgObsWrapper(env, 8)\n",
  291. " env = ImgObsWrapper(env)\n",
  292. " env = MiniWrapper(env)\n",
  293. "\n",
  294. " \n",
  295. " env.reset()\n",
  296. " Image.fromarray(env.render()).show()\n",
  297. " \n",
  298. " shield_handlers = dict()\n",
  299. " if shield_needed(shielding):\n",
  300. " for value in [0.9, 0.99, 0.999, 0.9999, 1.0]:\n",
  301. " shield_handler = MiniGridShieldHandler(GRID_TO_PRISM_BINARY, \"grid.txt\", \"grid.prism\", formula, shield_value=value, shield_comparison=shield_comparison, nocleanup=False, prism_file=None)\n",
  302. " env = MiniGridSbShieldingWrapper(env, shield_handler=shield_handler, create_shield_at_reset=False)\n",
  303. " create_shield_overlay_image(image_env, shield_handler.create_shield())\n",
  304. " print(f\"The shield for shield_value = {value}\")\n",
  305. "\n",
  306. " shield_handlers[value] = shield_handler\n",
  307. "\n",
  308. "\n",
  309. " if shielding == ShieldingConfig.Training:\n",
  310. " env = MiniGridSbShieldingWrapper(env, shield_handler=shield_handler, create_shield_at_reset=False)\n",
  311. " env = ActionMasker(env, mask_fn\n",
  312. " print(\"Training with shield:\")\n",
  313. " create_shield_overlay_image(image_env, shield_handlers[value_for_training].create_shield())\n",
  314. " elif shielding == ShieldingConfig.Disabled:\n",
  315. " env = ActionMasker(env, nomask_fn)\n",
  316. " else:\n",
  317. " assert(False) \n",
  318. " model = MaskablePPO(\"CnnPolicy\", env, verbose=1, device=\"auto\")\n",
  319. " model.set_logger(logger)\n",
  320. " steps = 20_000\n",
  321. "\n",
  322. " \n",
  323. " model.learn(steps,callback=[InfoCallback()])\n",
  324. "\n",
  325. "\n",
  326. "\n",
  327. "if __name__ == '__main__':\n",
  328. " print(\"Starting the training\")\n",
  329. " main()"
  330. ]
  331. },
  332. {
  333. "cell_type": "code",
  334. "execution_count": null,
  335. "metadata": {},
  336. "outputs": [],
  337. "source": []
  338. }
  339. ],
  340. "metadata": {
  341. "kernelspec": {
  342. "display_name": "Python 3 (ipykernel)",
  343. "language": "python",
  344. "name": "python3"
  345. },
  346. "language_info": {
  347. "codemirror_mode": {
  348. "name": "ipython",
  349. "version": 3
  350. },
  351. "file_extension": ".py",
  352. "mimetype": "text/x-python",
  353. "name": "python",
  354. "nbconvert_exporter": "python",
  355. "pygments_lexer": "ipython3",
  356. "version": "3.10.12"
  357. }
  358. },
  359. "nbformat": 4,
  360. "nbformat_minor": 4
  361. }