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.

352 lines
896 KiB

2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 months ago
2 days ago
2 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": 2,
  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.1 (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-11-29 10:15:58.098867: 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-11-29 10:15:58.215498: 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-11-29 10:15:58.247100: 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-11-29 10:15:58.481063: 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-11-29 10:16:01.296290: 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": 3,
  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/wAARCALAA2ADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDDooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAK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wARMwARFAQDCPgdknWdiRgxCMCSvIQW3Nv7aClCRwmCcss5Upz+Rcv7D4r7OAjM5TqE85fOz6y/frjxrmGbjb58Wftx9EZOGXms+fbD+yrQVp+PZ88/Sn69XiP/vv4fOPH1BqWL9FHXh1XQTevHnTtEAWiE3x2rkJmIAJTExAIk+/uYxqZAmZGEdCGurbN+QQd8Qmi8sw2ySBqMxCxmVpeLvXzQ+rSCaS3yN9snVK23+CsdnsBOKdHD4buRPx09Rv4dqr6yJggbiu+nRpTMAETGBfAlk66O1DedqpxGuZmKUhW8OsXyZ2BKIcSsa9/Gv5gZvixIkm/vLfWtSwsI9V+79GcVcgTl+/Qdy
  86. "text/plain": [
  87. "<PIL.Image.Image image mode=RGB size=864x704>"
  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 1.4756522178649902 seconds.\n",
  102. "LOG: Starting with model checking...\n",
  103. "Elapsed time is 0.007963895797729492 seconds.\n",
  104. "Write to file shielding_files_20241129T101609_2ylwmp9k/shield.\n",
  105. "LOG: Starting to translate shield...\n",
  106. "Elapsed time is 0.05611824989318848 seconds.\n",
  107. "\n",
  108. "\n",
  109. "Computing new shield\n",
  110. "LOG: Starting with explicit model creation...\n",
  111. "Elapsed time is 1.2929818630218506 seconds.\n",
  112. "LOG: Starting with model checking...\n",
  113. "Elapsed time is 0.0013511180877685547 seconds.\n",
  114. "Write to file shielding_files_20241129T101611_o5a_j5lh/shield.\n",
  115. "LOG: Starting to translate shield...\n",
  116. "Elapsed time is 0.05822467803955078 seconds.\n",
  117. "\n",
  118. "\n",
  119. "Computing new shield\n",
  120. "LOG: Starting with explicit model creation...\n",
  121. "Elapsed time is 1.192638874053955 seconds.\n",
  122. "LOG: Starting with model checking...\n",
  123. "Elapsed time is 0.0012052059173583984 seconds.\n",
  124. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 683\n",
  125. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 1139\n",
  126. "Write to file shielding_files_20241129T101613_79jou6ds/shield.\n",
  127. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 683\n",
  128. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 1139\n",
  129. "LOG: Starting to translate shield...\n",
  130. "Elapsed time is 0.051551103591918945 seconds.\n",
  131. "\n",
  132. "\n",
  133. "Computing new shield\n",
  134. "LOG: Starting with explicit model creation...\n",
  135. "Elapsed time is 1.1984505653381348 seconds.\n",
  136. "LOG: Starting with model checking...\n",
  137. "Elapsed time is 0.0012307167053222656 seconds.\n",
  138. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 610\n",
  139. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 611\n",
  140. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 635\n",
  141. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 659\n",
  142. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 683\n",
  143. "LOG: Starting to translate shield...\n",
  144. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 1139\n",
  145. "Write to file shielding_files_20241129T101615_2o4596m3/shield.\n",
  146. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 610\n",
  147. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 611\n",
  148. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 635\n",
  149. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 659\n",
  150. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 683\n",
  151. " WARN (PreShield.cpp:50): No shielding action possible with absolute comparison for state with index 1139\n",
  152. "Elapsed time is 0.05582904815673828 seconds.\n"
  153. ]
  154. },
  155. {
  156. "data": {
  157. "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2AAAALACAYAAAD1+RH+AAEAAElEQVR4Aez9z68d15XnCwYt4woGrsoGCRtkWhJzwho0/YCiB6KknKhgVL2eZI3Syj+gKeABPXGKE9fLsUo9oV2TBhJg9ahHKXmSgAfvZbbhUUumB6SBJN/ABDqTslSXlU4S8iMBw4Qs9v5EnO+56+y745w4cc85EffGdwHnRMT+tSK+sX99Y+1YcebatWvPK4sRMAJGwAgYASNgBIyAETACRsAIbB2Br2xdgxUYASNgBIyAETACRsAIGAEjYASMQI2ACZgrghEwAkbACBgBI2AEjIARMAJGYEcImIDtCGirMQJGwAgYASNgBIyAETACRsAImIC5DhgBI2AEjIARMAJGwAgYASNgBHaEgAnYjoC2GiNgBIyAETACRsAIGAEjYASMgAmY64ARMAJGwAgYASNgBIyAETACRmBHCJiA7QhoqzECRsAIGAEjYASMgBEwAkbACJiAuQ4YASNgBIyAETACRsAIGAEjYAR2hIAJ2I6AthojYASMgBEwAkbACBgBI2AEjIAJmOuAETACRsAIGAEjYASMgBEwAkZgRwiYgO0IaKsxAkbACBgBI2AEjIARMAJGwAiYgLkOGAEjYASMgBEwAkbACBgBI2AEdoSACdiOgLYaI2AEjIARMAJGwAgYASNgBIyACZjrgBEwAkbACBgBI2AEjIARMAJGYEcImIDtCGirMQJGwAgYASNgBIyAETACRsAImIC5DhgBI2AEjIARMAJGwAgYASNgBHaEgAnYjoC2GiNgBIyAETACRsAIGAEjYASMgAmY64ARMAJGwAgYASNgBIyAETACRmBHCJiA7QhoqzECRsAIGAEjYASMgBEwAkbACJiAuQ4YASNgBIyAETACRsAIGAEjYAR2hIAJ2I6AthojYASMgBEwAkbACBgBI2AEjIAJmOuAETACRsAIGAEjYASMgBEwAkZgRwiYgO0IaKsxAkbACBgBI2AEjIARMAJGwAiYgLkOGAEjYASMgBEwAkbACBgBI2AEdoSACdiOgLYaI2AEjIARMAJGwAgYASNgBIyACZjrgBEwAkbACBgBI2AEjIARMAJGYEcIm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E/nTuXc4zT7MR/GcWsKdPn1aPHj06skyVcOoM9eVCImlRltU/Hg5Ql+PDKFl56aNiuMrsOv9S+tLW/d/J7P+4l0Pcf1vAQivSkooQtNbucclbJ/3J0vXubMlHPDkI2aGhPcZ03++kf0lxO7l+629FwPg3brRbAVoR4frfLClbAVNrtOvfya1/TEjjpBTiBbGSlYt7CxFjUivCpa0qhCxjP0krMh6nQNyKM3G+mKxgbHn/i/2SsIzv44wIvfn/akjNu28kq1jK9F9/2+Rk4n8+8boLLzXHB0+q6uHTxiJ2L6WBZF1I8QezMFIViVeTvf5fqT85gZTFC+L1V+mcOC/kRynux7N4zvnuCdTPMsLL31okYm1YbgN/6gc/CcQLqxhbhLr08MUXq5+///7K+qclstRZ+nTqJXVbHjylI9+6/3f/n9eJdY6PO/6to2tTab+6qYI2UY4a6bplyewoq9e6+ZW+i/7X08CIOb4kacFH9WkpomNYF/2lonZ5/dZ/FAHj3yx72EX7O4p+8+4Lbcf6G6t/CaMuYe5/mkliF6ximk21f8rMiReTUogWk1jIGEsVcyIm4sXEl5GJibSWHTKBvnfv3gIRi+ee75eI0NszXvsXifj8MlUxES/l5ZhfJGL3YYBJVhGvJtXh/zL9OfFSLohYTRLT0Pzv/z8NETyp+ktETNeSEy9d/ybxz4lXXpf+LNW/V7IHAbH+cU55nS05jtG5x637n2H7n6njH+virvZHRcAYWPqw2DaT9rogdtH
  158. "text/plain": [
  159. "<PIL.Image.Image image mode=RGBA size=864x704>"
  160. ]
  161. },
  162. "metadata": {},
  163. "output_type": "display_data"
  164. },
  165. {
  166. "name": "stdout",
  167. "output_type": "stream",
  168. "text": [
  169. "The shield for shield_value = 0.9\n"
  170. ]
  171. },
  172. {
  173. "data": {
  174. "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2AAAALACAYAAAD1+RH+AAEAAElEQVR4Aez9z68dx5nnDSYt4xIGrtoGCRtkWRJrw14M1UDTC1GSN2oY3T2b6lVZ/gOGAhqYjUrcuNprtWZDuzcDFMCe1axK8qYAL963agyvRjK9IA2YfBdFYLpIS33Z5SIhvyRgmJB1Jz6Z53vuc+JGnpMnz488vPl9gHMyM349md+MeCK++URGnrp69ephZTECRsAIGAEjYASMgBEwAkbACBiBjSPwlY1rsAIjYASMgBEwAkbACBgBI2AEjIARqBEwAXNFMAJGwAgYASNgBIyAETACRsAIbAkBE7AtAW01RsAIGAEjYASMgBEwAkbACBgBEzDXASNgBIyAETACRsAIGAEjYASMwJYQMAHbEtBWYwSMgBEwAkbACBgBI2AEjIARMAFzHTACRsAIGAEjYASMgBEwAkbACGwJAROwLQFtNUbACBgBI2AEjIARMAJGwAgYARMw1wEjYASMgBEwAkbACBgBI2AEjMCWEDAB2xLQVmMEjIARMAJGwAgYASNgBIyAETABcx0wAkbACBgBI2AEjIARMAJGwAhsCQETsC0BbTVGwAgYASNgBIyAETACRsAIGAETMNcBI2AEjIARMAJGwAgYASNgBIzAlhAwAdsS0FZjBIyAETACRsAIGAEjYASMgBEwAXMdMAJGwAgYASNgBIyAETACRsAIbAkBE7AtAW01RsAIGAEjYASMgBEwAkbACBgBEzDXASNgBIyAETACRsAIGAEjYASMwJYQMAHbEtBWYwSMgBEwAkbACBgBI2AEjIARMAFzHTACRsAIGAEjYASMgBEwAkbACGwJAROwLQFtNUbACBgBI2AEjIARMAJGwAgYARMw1wEjYASMgBEwAkbACBgBI2AEjMCWEDAB2xLQVmMEjIARMAJGwAgYASNgBIyAETABcx0wAkbACBgBI2AEjIARMAJGwAhsCQETsC0BbTVGwAgYASNgBIyAETACRsAIGAETMNcBI2AEjIARMAJGwAgYASNgBIzAlhAwAdsS0FZjBIyAETACRsAIGAEjYASMgBEwAXMdMAJGwAgYASNgBIyAETACRsAIbAkBE7AtAW01RsAIGAEjYASMgBEwAkbACBgBEzDXASNgBIyAETACRsAIGAEjYASMwJYQMAHbEtBWYwSMgBEwAkbACBgBI2AEjIARMAFzHTACRsAIGAEjYASMgBEwAkbACGwJAROwLQFtNUbACBgBI2AEjIARMAJGwAg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jC1CXXp4+nT1iw8+WFj/NI2MOkufRr2kbmsFT+nIt+7/3P/ldWKZ41X7v2V0rSvtV9dV0DrKUSNdtiy5nfXUcdn8Sm/9jZEUHl23xr9x+7v+NV7nrvUmT+f25/YXvT95/Wg7Pin2h+vLiReDUogWg1jIGFMVcyIm4sXA95epDAbSmnbIAPru3bszRKwNR8JLROjtCa/9y0R8fpWauIiXyuGYXyRi92CASRYRrybV0f88/TnxUi6IWE0SEwn7d/+fhgg+r/pLREzXkhMvXf868c+JV16Xvpvq38vZg4BY/zinvM6WFo7Rucet7b/t/5D2P9bFbe3vFAGjY+nDYttc2suCaP3G3/VveS+C2195So3tz3IIjNn+loiXPAegSBuLaUTEiJPH4U4iXvJ2Ec53neKAui8Rw7v0+stHHqf8nTB0IZEI8H4YXjAIRR+JROyY/pYC37ubIs43RPB51x+JGJ7E2quYSO48WQX/WE/QAfFqq0t4WF+fPAggrepf9HYRntfZRURszO0fvHz9w44/uQfblp0iYMu6oJlTrCka6wDO+pdzgRt/1z+3P3wO6xHbn/HaHwZftKV8EBtrFh4CSFgkYsST5x+ePJmZQqZ8DKT5uG4cYPNOT74
  175. "text/plain": [
  176. "<PIL.Image.Image image mode=RGBA size=864x704>"
  177. ]
  178. },
  179. "metadata": {},
  180. "output_type": "display_data"
  181. },
  182. {
  183. "name": "stdout",
  184. "output_type": "stream",
  185. "text": [
  186. "The shield for shield_value = 0.95\n"
  187. ]
  188. },
  189. {
  190. "data": {
  191. "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2AAAALACAYAAAD1+RH+AAEAAElEQVR4Aez9T8wcx5XmjRYlg4QBsm2QsCDakugNe9H0AE0tREmzccMYz91Mr0b0bhZzSWCAuxhZ3LTHa0/3hlbP4gINcO7qriT1pgEO8H2aa4w3VxS9IA2M+C2aizb1Z8hpi4ZsETAsyOQXv8x66j0Vb2RVVtafzPfN5wBVmRkZESfzyYiT8eSJP0cuXbr0ZGIxAkbACBgBI2AEjIARMAJGwAgYga0j8NTWNViBETACRsAIGAEjYASMgBEwAkbACFQImIC5IBgBI2AEjIARMAJGwAgYASNgBHaEgAnYjoC2GiNgBIyAETACRsAIGAEjYASMgAmYy4ARMAJGwAgYASNgBIyAETACRmBHCJiA7QhoqzECRsAIGAEjYASMgBEwAkbACJiAuQwYASNgBIyAETACRsAIGAEjYAR2hIAJ2I6AthojYASMgBEwAkbACBgBI2AEjIAJmMuAETACRsAIGAEjYASMgBEwAkZgRwiYgO0IaKsxAkbACBgBI2AEjIARMAJGwAiYgLkMGAEjYASMgBEwAkbACBgBI2AEdoSACdiOgLYaI2AEjIARMAJGwAgYASNgBIyACZjLgBEwAkbACBgBI2AEjIARMAJGYEcImIDtCGirMQJGwAgYASNgBIyAETACRsAImIC5DBgBI2AEjIARMAJGwAgYASNgBHaEgAnYjoC2GiNgBIyAETACRsAIGAEjYASMgAmYy4ARMAJGwAgYASNgBIyAETACRmBHCJiA7QhoqzECRsAIGAEjYASMgBEwAkbACJiAuQwYASNgBIyAETACRsAIGAEjYAR2hIAJ2I6AthojYASMgBEwAkbACBgBI2AEjIAJmMuAETACRsAIGAEjYASMgBEwAkZgRwiYgO0IaKsxAkbACBgBI2AEjIARMAJGwAiYgLkMGAEjYASMgBEwAkbACBgBI2AEdoSACdiOgLYaI2AEjIARMAJGwAgYASNgBIyACZjLgBEwAkbACBgBI2AEjIARMAJGYEcImIDtCGirMQJGwAgYASNgBIyAETACRsAImIC5DBgBI2AEjIARMAJGwAgYASNgBHaEgAnYjoC2GiNgBIyAETACRsAIGAEjYASMgAmYy4ARMAJGwAgYASNgBIyAETACRmBHCJiA7QhoqzECRsAIGAEjYASMgBEwAkbACJiAuQwYASNgBIyAETACRsAIGAEjYAR2hIAJ2I6AthojYASMgBEwAkbACBgBI2AEjMBX+obg2rVrfV+C9RsBI2AEjIARGCQC77zzzuTll1+ePP/8862u76OPPpq8//77k9dee215/OePLI+z7RiXtq1gQf7/NZ3rW/+Cy9v6qW9dmKTCslDNVsvfQs0+aQS2i8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r42k8Gi7Nf6129/lr/Y6ty03eTzXP9e/6P3Jy0fT8WGxP9xfTrxolEK0aMRCxuiqmBMxES8avu+nPGhIq9shDeg7d+7MEbEmHAkvEaGLU177bxPx+UWq4iJeyodjfpGI3YUBJllGvOpYe/+L9OfES6kgYhVJTCTsL/5/NRE8qPpLREz3khMv3f8m8c+JV16W/mUqf89nHwJi+eOa8jJbmjhG1x63tv+2/33a/1gWd7U/KALGi6ULi21yaa8KovUbf5e/1b0Irn/lLjW2P6shMGb7WyJe8hyAInUsxhER45w8Dh8k4iVvF+Gs6xQb1F2JGN6ll5/f8zjlY8LQhUQiwPgwvGAQii4Sidg+/Q0ZvnEnnThdE8GDrj8SMTyJlVcxkdxFsg7+sZygA+LVVJbwsL48/RBAXJW/6O0iPC+zy4jYmOs/ePn++21/8gx2LYMiYKu6oOlTrC4amwDO+ldzgRt/lz/XP3wOmxHbn/HaHxpf1KW8ERtLFh4CSFgkYpwnzX///PO5LmRKR0OaxXV
  192. "text/plain": [
  193. "<PIL.Image.Image image mode=RGBA size=864x704>"
  194. ]
  195. },
  196. "metadata": {},
  197. "output_type": "display_data"
  198. },
  199. {
  200. "name": "stdout",
  201. "output_type": "stream",
  202. "text": [
  203. "The shield for shield_value = 0.99\n"
  204. ]
  205. },
  206. {
  207. "data": {
  208. "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2AAAALACAYAAAD1+RH+AAEAAElEQVR4Aez9S8wdx5mmiy5KBgkDZNkgYUG0LvSENSi6gaIGoqWeuGBs95nsGrXoWQ/6kEADZ9CyOCm3x+6qCS3X4AAFsM/ojEzWpAE1sLf6GO3JEUUPSAMt7kFxUKYuRW1bNGSLgLcFmdzxZK53/d+KP3KtXLkumf+f7weslZmREfFlvnHJeOOLy5FLly49mViMgBEwAkbACBgBI2AEjIARMAJGYOsIPLV1DVZgBIyAETACRsAIGAEjYASMgBEwAhUCJmDOCEbACBgBI2AEjIARMAJGwAgYgR0hYAK2I6CtxggYASNgBIyAETACRsAIGAEjYALmPGAEjIARMAJGwAgYASNgBIyAEdgRAiZgOwLaaoyAETACRsAIGAEjYASMgBEwAiZgzgNGwAgYASNgBIyAETACRsAIGIEdIWACtiOgrcYIGAEjYASMgBEwAkbACBgBI2AC5jxgBIyAETACRsAIGAEjYASMgBHYEQImYDsC2mqMgBEwAkbACBgBI2AEjIARMAImYM4DRsAIGAEjYASMgBEwAkbACBiBHSFgArYjoK3GCBgBI2AEjIARMAJGwAgYASNgAuY8YASMgBEwAkbACBgBI2AEjIAR2BECJmA7AtpqjIARMAJGwAgYASNgBIyAETACJmDOA0bACBgBI2AEjIARMAJGwAgYgR0hYAK2I6CtxggYASNgBIyAETACRsAIGAEjYALmPGAEjIARMAJGwAgYASNgBIyAEdgRAiZgOwLaaoyAETACRsAIGAEjYASMgBEwAiZgzgNGwAgYASNgBIyAETACRsAIGIEdIWACtiOgrcYIGAEjYASMgBEwAkbACBgBI2AC5jxgBIyAETACRsAIGAEjYASMgBHYEQImYDsC2mqMgBEwAkbACBgBI2AEjIARMAImYM4DRsAIGAEjYASMgBEwAkbACBiBHSFgArYjoK3GCBgBI2AEjIARMAJGwAgYASNgAuY8YASMgBEwAkbACBgBI2AEjIAR2BECJmA7AtpqjIARMAJGwAgYASNgBIyAETACJmDOA0bACBgBI2AEjIARMAJGwAgYgR0hYAK2I6CtxggYASNgBIyAETACRsAIGAEjYALmPGAEjIARMAJGwAgYASNgBIyAEdgRAiZgOwLaaoyAETACRsAIGAEjYASMgBEwAiZgzgNGwAgYASNgBIyAETACRsAIGIEdIWACtiOgrcYIGAEjYASMgBEwAkbACBgBI/ClviG4du1a349g/UbACBgBI2AEBonAjRs3Jt/61rcmL7zwQqvn++CDDybvvvvu5LXXXlvu/4Ujy/1s28elbStYEP9/Sff61r/g8bZ+67kLk5RZFqrZav5bqNk3jcB2Ebh8+fJ2FSyJ3RawJQD5thEwAkbACBiBXSPw4x//uCJdFy9enLz44ouTN954YwK5ahLu4Qe/hIGwEUejJFI3aoF89Sl969e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hG7BwNMsox41b72/hfpz4mXQkHEKpKYSNhf/f9qInhQ9ZeImN4lJ156/03inxOvPC/965T/Xsg6AmL+45nyPFtaOEbPHo+u/13/91n/x7y4q/NBETA+LF1YbJNJe1UQrd/4O/+tbkVw+SsPqXH9sxoCY65/S8RLlgNQpIxFPyJi3JPF4b1EvGTtwp19nWKDuisRw7r0rRf2LE75nDB0IZEIMD8MKxiEootEIrZPf0OEb9xNN07XRPCg649EDEtiZVVMJHeRrIN/zCfogHg15SUsrN+adgTgV/kvWrtwz/PsMiI25vIPXn7/ftufpMGuZVAEbFUTNGOKNURjE8BZ/2omcOPv/Ofyh81hM+L6Z7z1D40vylLeiI05CwsBJCwSMe4T5r9/9tncEDKFoyHN5rq
  209. "text/plain": [
  210. "<PIL.Image.Image image mode=RGBA size=864x704>"
  211. ]
  212. },
  213. "metadata": {},
  214. "output_type": "display_data"
  215. },
  216. {
  217. "name": "stdout",
  218. "output_type": "stream",
  219. "text": [
  220. "The shield for shield_value = 1.0\n",
  221. "Training with shield:\n"
  222. ]
  223. },
  224. {
  225. "data": {
  226. "image/png": "iVBORw0KGgoAAAANSUhEUgAAA2AAAALACAYAAAD1+RH+AAEAAElEQVR4Aez9Tcwdx5Wmi25KBgkDZNkgYUG0fugJa1B0A0UNREk9ccE47js5NWrRsx70JYED3EHL4qTcHrurJrSqBxcogH1HdySxJg2ogXPU12hPrih6QBpo8QyKgzL1U+SxTUO2CBgWZPLEk7nf/a0dX+TeuXP/ZH5fvgvYOzMjI2JlvhmxMt5c8XPk0qVLTyYWI2AEjIARMAJGwAgYASNgBIyAEdg6Ak9tXYMVGAEjYASMgBEwAkbACBgBI2AEjECFgAmYC4IRMAJGwAgYASNgBIyAETACRmBHCJiA7QhoqzECRsAIGAEjYASMgBEwAkbACJiAuQwYASNgBIyAETACRsAIGAEjYAR2hIAJ2I6AthojYASMgBEwAkbACBgBI2AEjIAJmMuAETACRsAIGAEjYASMgBEwAkZgRwiYgO0IaKsxAkbACBgBI2AE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8jJbmjhG1x63tv+2/33a/1gWd7U/KALGi6ULi21yaa8KovUbf5e/1b0Irn/lLjW2P6shMGb7WyJe8hyAInUsxhER45w8Dh8m4iVvF+Gs6xQb1F2JGN6lV17Y8zjlY8LQhUQiwPgwvGAQii4Sidg+/Q0ZvnknnThdE8GDrj8SMTyJlVcxkdxFsg7+sZygA+LVVJbwsL4y/RBAXJW/6O0iPC+zy4jYmOs/ePn++21/8gx2LYMiYKu6oOlTrC4amwDO+ldzgRt/lz/XP3wOmxHbn/HaHxpf1KW8ERtLFh4CSFgkYpwnzX///PO5LmRKR0OaxXV
  227. "text/plain": [
  228. "<PIL.Image.Image image mode=RGBA size=864x704>"
  229. ]
  230. },
  231. "metadata": {},
  232. "output_type": "display_data"
  233. },
  234. {
  235. "name": "stdout",
  236. "output_type": "stream",
  237. "text": [
  238. "Using cpu device\n",
  239. "Wrapping the env with a `Monitor` wrapper\n",
  240. "Wrapping the env in a DummyVecEnv.\n",
  241. "Wrapping the env in a VecTransposeImage.\n"
  242. ]
  243. },
  244. {
  245. "ename": "AssertionError",
  246. "evalue": "",
  247. "output_type": "error",
  248. "traceback": [
  249. "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
  250. "\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)",
  251. "Cell \u001b[0;32mIn[3], line 63\u001b[0m\n\u001b[1;32m 61\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;18m__name__\u001b[39m \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m__main__\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[1;32m 62\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mStarting the training\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m---> 63\u001b[0m \u001b[43mmain\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
  252. "Cell \u001b[0;32mIn[3], line 56\u001b[0m, in \u001b[0;36mmain\u001b[0;34m()\u001b[0m\n\u001b[1;32m 53\u001b[0m model\u001b[38;5;241m.\u001b[39mset_logger(logger)\n\u001b[1;32m 54\u001b[0m steps \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m20_000\u001b[39m\n\u001b[0;32m---> 56\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m(\u001b[38;5;28;01mFalse\u001b[39;00m)\n\u001b[1;32m 57\u001b[0m model\u001b[38;5;241m.\u001b[39mlearn(steps,callback\u001b[38;5;241m=\u001b[39m[InfoCallback()])\n",
  253. "\u001b[0;31mAssertionError\u001b[0m: "
  254. ]
  255. }
  256. ],
  257. "source": [
  258. "GRID_TO_PRISM_BINARY=os.getenv(\"M2P_BINARY\")\n",
  259. "\n",
  260. "def mask_fn(env: gym.Env):\n",
  261. " return env.create_action_mask()\n",
  262. "\n",
  263. "def nomask_fn(env: gym.Env):\n",
  264. " return [1.0] * 7\n",
  265. "\n",
  266. "def main():\n",
  267. " #env = \"MiniGrid-LavaSlipperyCliff-16x13-Slip10-Time-v0\"\n",
  268. " env = \"MiniGrid-WindyCity-Adv-v0\"\n",
  269. "\n",
  270. " formula = \"Pmax=? [G ! AgentIsOnLava]\"\n",
  271. " value_for_training = 0.99\n",
  272. " shield_comparison = \"absolute\"\n",
  273. " shielding = ShieldingConfig.Training\n",
  274. " \n",
  275. " logger = Logger(\"/tmp\", output_formats=[HumanOutputFormat(sys.stdout)])\n",
  276. " \n",
  277. " env = gym.make(env, render_mode=\"rgb_array\")\n",
  278. " image_env = RGBImgObsWrapper(env, TILE_PIXELS)\n",
  279. " env = RGBImgObsWrapper(env, 8)\n",
  280. " env = ImgObsWrapper(env)\n",
  281. " env = MiniWrapper(env)\n",
  282. "\n",
  283. " \n",
  284. " env.reset()\n",
  285. " Image.fromarray(env.render()).show()\n",
  286. " \n",
  287. " shield_handlers = dict()\n",
  288. " if shield_needed(shielding):\n",
  289. " for value in [0.9, 0.95, 0.99, 1.0]:\n",
  290. " shield_handler = MiniGridShieldHandler(GRID_TO_PRISM_BINARY, \"grid.txt\", \"grid.prism\", formula, shield_value=value, shield_comparison=shield_comparison, nocleanup=True, prism_file=None)\n",
  291. " env = MiniGridSbShieldingWrapper(env, shield_handler=shield_handler, create_shield_at_reset=False)\n",
  292. "\n",
  293. "\n",
  294. " shield_handlers[value] = shield_handler\n",
  295. " if shield_needed(shielding):\n",
  296. " for value in [0.9, 0.95, 0.99, 1.0]: \n",
  297. " create_shield_overlay_image(image_env, shield_handlers[value].create_shield())\n",
  298. " print(f\"The shield for shield_value = {value}\")\n",
  299. "\n",
  300. " if shielding == ShieldingConfig.Training:\n",
  301. " env = MiniGridSbShieldingWrapper(env, shield_handler=shield_handlers[value_for_training], create_shield_at_reset=False)\n",
  302. " env = ActionMasker(env, mask_fn)\n",
  303. " print(\"Training with shield:\")\n",
  304. " create_shield_overlay_image(image_env, shield_handlers[value_for_training].create_shield())\n",
  305. " elif shielding == ShieldingConfig.Disabled:\n",
  306. " env = ActionMasker(env, nomask_fn)\n",
  307. " else:\n",
  308. " assert(False) \n",
  309. " model = MaskablePPO(\"CnnPolicy\", env, verbose=1, device=\"auto\")\n",
  310. " model.set_logger(logger)\n",
  311. " steps = 20_000\n",
  312. "\n",
  313. " assert(False)\n",
  314. " model.learn(steps,callback=[InfoCallback()])\n",
  315. "\n",
  316. "\n",
  317. "\n",
  318. "if __name__ == '__main__':\n",
  319. " print(\"Starting the training\")\n",
  320. " main()"
  321. ]
  322. },
  323. {
  324. "cell_type": "code",
  325. "execution_count": null,
  326. "metadata": {},
  327. "outputs": [],
  328. "source": []
  329. }
  330. ],
  331. "metadata": {
  332. "kernelspec": {
  333. "display_name": "Python 3 (ipykernel)",
  334. "language": "python",
  335. "name": "python3"
  336. },
  337. "language_info": {
  338. "codemirror_mode": {
  339. "name": "ipython",
  340. "version": 3
  341. },
  342. "file_extension": ".py",
  343. "mimetype": "text/x-python",
  344. "name": "python",
  345. "nbconvert_exporter": "python",
  346. "pygments_lexer": "ipython3",
  347. "version": "3.10.12"
  348. }
  349. },
  350. "nbformat": 4,
  351. "nbformat_minor": 4
  352. }