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.

369 lines
135 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months 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": 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-24 13:31:25.321557: 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-24 13:31:25.336097: 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-24 13:31:25.340241: 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-24 13:31:25.350298: 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-24 13:31:26.198496: 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/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDDooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAPMtU1TUI9XvUS/ulRZ3CqszAAbjwOaqf2vqf8A0Ebv/v8At/jRq/8AyGr/AP6+JP8A0I1ToAuf2vqf/QRu/wDv+3+NH9r6n/0Ebv8A7/t/jVOigDWmaQHh1jTu561DGxz+4nLHuknf6VJKoM2ViLvjq33RTHDMMyIky/3o+q1+lYqVR15STejevvafNWS87Rmv5mccbWEkY5/fzlT2SPt9amhaQnl1kTs461EgZRmNEhX+9J1anxKBNloij46r900YWVT28ZNvVrX3tfm7p+V4wX8rCVrDpmkB4dY07uetQxsc/uJyx7pJ3+lSSqDNlYi746t90UxwzDMiJMv96PqtGKlUdeUk3o3r72nzVkvO0Zr+ZhG1hJGOf385U9kj7fWpoWkJ5dZE7OOtRIGUZjRIV/vSdW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dnakCZBepilokmQim61rNh3NdK9lZ21Xd2j5Wc7efYJJvvz7efmx381t5uTfpF3dFZ1LqymhJQSCMzxImIJ/aQNOwKaRZhuXux27TmXbeuAWcmWnLVr06V01iqbhvI8/96lmvbXm9vm6x/N/cPWLy+eNu9/am7tm7N6Vve1ufu
  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.058641910552978516 seconds.\n",
  102. "LOG: Starting with model checking...\n",
  103. "Elapsed time is 0.0003376007080078125 seconds.\n",
  104. "LOG: Starting to translate shield...\n",
  105. "Write to file shielding_files_20240924T133128_pk5u63e5/shield.\n",
  106. "Elapsed time is 0.013018369674682617 seconds.\n"
  107. ]
  108. },
  109. {
  110. "data": {
  111. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAug0lEQVR4Ae2dz64ky1Wvq03rIKSDQFh3gyVzLA884gHu5j7Enl0/QfEAHM/6AXoGfgDXE5jZHiEeAPYdMWKEhOVjS8f3ICwjjoQ4MmryV9WrO3bsysp/kRlrZXwhVWdlZMRaEV+s+q2szNzVr47H47sDBQIQgAAEmiPwreZmzIQhAAEIQOBMgARAIEAAAhBolAAJoNGFZ9oQgAAESADEAAQgAIFGCZAAGl14pg0BCECABEAMQAACEGiUAAmg0YVn2hCAAARIAMQABCAAgUYJkAAaXXimDQEIQIAEQAxAAAIQaJQACaDRhWfaEIAABEgAxAAEIACBRgmQABpdeKYNAQhAgARADEAAAhBolAAJoNGFZ9oQgAAESADEAAQgAIFGCZAAGl14pg0BCECABEAMQAACEGiUAAmg0YVn2hCAAARIAMQABCAAgUYJkAAaXXimDQEIQIAEQAxAAAIQaJQACaDRhWfaEIAABEgAxAAE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bsWcdcJwCFgWd4+wpTL7PhW4CXlWAcywl41y/3CUBL4B3i8jDBwkcC6bcAPbmjom8BKmkk2M92pJdzrJ3V6XJR3u6a/bNx/oFAUQJptBY1XNBYiASg+UaAWXBdGjalp3Zste/fc7Cne2xf1ZYc7B6B6uzbQ9rO+loiuGZffSkQKEfAIricxXUshUkAmn4UqOssVStW7exdwq4zeBU7szeBl4in7dRGQq8I0VNDaXs9VaSEoDN/lbSf2b8c4V8IlCAQSadCJQAtTiS4JYKpLRu3hH1IxE30028EJva
  112. "text/plain": [
  113. "<PIL.Image.Image image mode=RGBA size=384x384>"
  114. ]
  115. },
  116. "metadata": {},
  117. "output_type": "display_data"
  118. },
  119. {
  120. "name": "stdout",
  121. "output_type": "stream",
  122. "text": [
  123. "The shield for shield_value = 0.9\n",
  124. "\n",
  125. "\n",
  126. "Computing new shield\n",
  127. "LOG: Starting with explicit model creation...\n",
  128. "Elapsed time is 0.05918574333190918 seconds.\n",
  129. "LOG: Starting with model checking...\n",
  130. "Elapsed time is 0.0002396106719970703 seconds.\n",
  131. "LOG: Starting to translate shield...\n",
  132. "Write to file shielding_files_20240924T133128_3pf0niht/shield.\n",
  133. "Elapsed time is 0.011339187622070312 seconds.\n"
  134. ]
  135. },
  136. {
  137. "data": {
  138. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAukklEQVR4Ae2dz64kyVWHq4fWIKRBIFtcPNJ4LC+84gEo8xB3h3mB4gFo7/oBWmyM2buewOzuCvEAcFl5xcoSlscWYwZhGTESYmTUxO/WPd1x41ZW/qnMjHMyvpCyszIy4pyIL079TlZW3uoXh8Ph7Y4CAQhAAALNEfiguRkzYQhAAAIQeCBAAiAQIAABCDRKgATQ6MIzbQhAAAIkAGIAAhCAQKMESACNLjzThgAEIEACIAYgAAEINEqABNDowjNtCEAAAiQAYgACEIBAowRIAI0uPNOGAAQgQAIgBiAAAQg0SoAE0OjCM20IQAACJABiAAIQgECjBEgAjS4804YAB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z6gbw+cc/bC50e0S0F/5x9taVAYB0CHnXNZQLQcniEtU6YtOzFhNyu7sXChNw+BVwS96GJIrffMm/mvhYBr3rmNgFoYbxCWyto2vNz7iqdTwHtxcG2ZuxZx1wnAIWBZ3jbClMvs+FTgJeVYBzXE/CuX+4TgJbAO8TrwwQL7wnknwL05I6KPgWo5JFgP9uR386xdlan20Vlu3P2H4zzDwRmJZBH66yGZzQWIgFovhFgzrguDZvSUzu22vtHDvZ0jx2r2pKDfUegOvv0kLezvpYIztlXXwoE5iNgETyfxWUshUkAmn4UqMssVStW7epdwq4reBW7sjeBl4jn7dRGQq8I0VNDeXs9VaSEoCt/lbyf2T+d4V8IzEEgkk6FSgBanEhw5wimtmxcEvY+ETfRzz8RmNhfShxtEWa
  139. "text/plain": [
  140. "<PIL.Image.Image image mode=RGBA size=384x384>"
  141. ]
  142. },
  143. "metadata": {},
  144. "output_type": "display_data"
  145. },
  146. {
  147. "name": "stdout",
  148. "output_type": "stream",
  149. "text": [
  150. "The shield for shield_value = 0.99\n",
  151. "\n",
  152. "\n",
  153. "Computing new shield\n",
  154. "LOG: Starting with explicit model creation...\n",
  155. "Elapsed time is 0.05561947822570801 seconds.\n",
  156. "LOG: Starting with model checking...\n",
  157. "Elapsed time is 0.00025653839111328125 seconds.\n",
  158. "LOG: Starting to translate shield...\n",
  159. "Write to file shielding_files_20240924T133129_kc6xcewk/shield.\n",
  160. "Elapsed time is 0.012254714965820312 seconds.\n"
  161. ]
  162. },
  163. {
  164. "data": {
  165. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAubElEQVR4Ae2dz44ky1WHa8zoIqSLQFg0WLq+lhde8QA0PETv8BMUD8B4Nw8wO+ABXE9gdr1CPAA0K1askLB8sXTNRVhGXAlxZTTkr6vPTHR0ZeW/yIxzMr6QarIyMuKciC9O/U5WZnbNq+Px+P5AgQAEIACB5gh8q7kZM2EIQAACEHgkQAIgECAAAQg0SoAE0OjCM20IQAACJABi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Oulx2itaF9PTaXibkJu4q4/tlNdmii0b327t4/F6lL7dowtBLYj4EnnXCUALYEnONuFBJ6e/5Gd8dAjsSqpuFudPYKrp6puu5cixxJF2sYSRVrXNaVAoAIBb/rmLgFoTbxBqhAnDbo0IdcZvZ2lS/j1A3lD4p62Fzo9opsL/iX7akuBwDYEPOqaywSg5fAIa5swadmLCbmd3YuFCbl9C7gm7mMTRWq/Zd7MfSsCXvXMbQLQwniFtlXQtOfn0lk63wLai4N9zdizjrlOAAoDz/D2FaZeZsO3AC8rwTiWE/CuX+4TgJbAO8TlYYKFjwTSbwF6ckdF3wJU0kiwn+1IL+dYO6vT5aK83SX7j8b5BwJFCaTRWtRwQWMhEoDmGwFmwXVp2JSe2rHVvn3iYE/32L6qLTnYPQLV2beHtJ31tURwyb76UiBQjoBFcDmL61gKkwA0/ShQ11mqVqza2buEXWfwKnZmbwIvEU/bqY2EXhGip4bS9nqqSAlBZ/4qaT+zfz7CvxAoQSCSToVKAFqcSHBLBFNbNq4J+5CIm+in3whM7K8ljrY
  166. "text/plain": [
  167. "<PIL.Image.Image image mode=RGBA size=384x384>"
  168. ]
  169. },
  170. "metadata": {},
  171. "output_type": "display_data"
  172. },
  173. {
  174. "name": "stdout",
  175. "output_type": "stream",
  176. "text": [
  177. "The shield for shield_value = 0.999\n",
  178. "\n",
  179. "\n",
  180. "Computing new shield\n",
  181. "LOG: Starting with explicit model creation...\n",
  182. "Elapsed time is 0.05743050575256348 seconds.\n",
  183. "LOG: Starting with model checking...\n",
  184. "Elapsed time is 0.0002510547637939453 seconds.\n",
  185. "LOG: Starting to translate shield...\n",
  186. "Write to file shielding_files_20240924T133129_xvlqgzvq/shield.\n",
  187. "Elapsed time is 0.011241436004638672 seconds.\n"
  188. ]
  189. },
  190. {
  191. "data": {
  192. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAufElEQVR4Ae2dz44ky1WHa8zoIqSLQFg0WLq+lhde8QA0PETv8BMUD8B4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i0tAx9Pp8VmZGgvRJcDDqfNfq7Tu/3ComwC07qx/u/HfnQFUW/+HLvZubm5qSc+jXzeXgASD0jIB/eV0/nTUm65Or7SoTfpX1vobDNXpBrsVvVedjlm5ZN+OsYXAtgS86J2bBCD8XqBsGwp4OxOQQOulx2itaF9PTaXibkJu4q4/tlNdmii0b327t4/F6lL7dowtBLYj4EnnXCUALYEnONuFBJ6e/5Gd8dAjsSqpuFudPYKrp6puu5cixxJF2sYSRVrXNaVAoAIBb/rmLgFoTbxBqhAnDbo0IdcZvZ2lS/j1A3lD4p62Fzo9opsL/iX7akuBwDYEPOqaywSg5fAIa5swadmLCbmd3YuFCbl9C7gm7mMTRWq/Zd7MfSsCXvXMbQLQwniFtlXQtOfn0lk63wLai4N9zdizjrlOAAoDz/D2FaZeZsO3AC8rwTiWE/CuX+4TgJbAO8TlYYKFjwTSbwF6ckdF3wJU0kiwn+1IL+dYO6vT5aK83SX7j8b5BwJFCaTRWtRwQWMhEoDmGwFmwXVp2JSe2rHVvn3iYE/32L6qLTnYPQLV2beHtJ31tURwyb76UiBQjoBFcDmL61gKkwA0/ShQ11mqVqza2buEXWfwKnZmbwIvEU/bqY2EXhGip4bS9nqqSAlBZ/4qaT+zfz7CvxAoQSCSToVKAFqcSHBLBFNbNq4J+5CIm+in3whM7K8ljrY
  193. "text/plain": [
  194. "<PIL.Image.Image image mode=RGBA size=384x384>"
  195. ]
  196. },
  197. "metadata": {},
  198. "output_type": "display_data"
  199. },
  200. {
  201. "name": "stdout",
  202. "output_type": "stream",
  203. "text": [
  204. "The shield for shield_value = 0.9999\n",
  205. "\n",
  206. "\n",
  207. "Computing new shield\n",
  208. "LOG: Starting with explicit model creation...\n",
  209. "Elapsed time is 0.057801008224487305 seconds.\n",
  210. "LOG: Starting with model checking...\n",
  211. "Elapsed time is 0.0002875328063964844 seconds.\n",
  212. "LOG: Starting to translate shield...\n",
  213. "Elapsed time is 0.011219024658203125 seconds.\n",
  214. "Write to file shielding_files_20240924T133129_9qlpdi5z/shield.\n"
  215. ]
  216. },
  217. {
  218. "data": {
  219. "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAugUlEQVR4Ae2dT44kyXWno6hCCwJakCBiUiJANcEFVzrA5MwhcieeIHSAKe7qALXT6ACME3B2uRJ0AClnpZVWAoZgi0BTLYigoAYENSjU+C8jX6WlZXj4P3O399w+A6I83NzsPbPPXvyeh7tn1Jvj8fjxQIEABCAAgeYIfKe5GTNhCEAAAhB4JEACIBAgAAEINEqABNDowjNtCEAAAiQAYgACEIBAowRIAI0uPNOGAAQgQAIgBiAAAQg0SoAE0OjCM20IQAACJABiAAIQgECjBEgAjS4804YABCBAAiAGIAABCDRKgATQ6MIzbQhAAAIkAGIAAhCAQKMESACNLjzThgAEIEACIAYgAAEINEqABNDowjNtCEAAAiQAYgACEIBAowRIAI0uPNOGAAQgQAIgBiAAAQg0SoAE0OjCM20IQAACJABiAAIQgECjBEgAjS4804YABCBAAiAGIAABCDRKgATQ6MIzbQhAAAIkAGIAAhCAQKMESACNLjzThgAEIEACIAYgAAEINEqABNDowjNtCEAAAiQAYgACEIBAowRIAI0uPNOGAAQgQAIgBiAAAQg0SoAE0OjCM20IQAACb2sjeH9/X3UIX3/9w8Pt4WFgDP+nO37bvf50oJ0d/qfujWz+uVUs3O7X//+7+eOFbOgOgfkEvv7h1/M7F+h58/Obw4e7uwKW5pmongA07K+/rrcIt4d/vkLuf3fH/qp7/fKpzf/qtnr1JQIJv9rrpfL97qX277Qzo+zfv4L/eDrNYFOmy+l4xH/D/A8/LBNHUa00fQlI5/SXi4RXIv+T7iXxt5YS9i+6lwRdYm9F71WnYyb+6qO+siFbsjm2tOXf6I6lU6qd+bVtKbtj7Zhf247tV6qd+bVtKbtj7Zhf247tV6pdLb+lxl/CTrMJ4PLiXxLev+04/133+rJ76WxeJU0EufCrjdqqj/rK09hE0K7/y+vRoVup5P7y/ZXcfjKb+8v3PzVc6U3uL99fye0ns7m/fP9T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z+y4D0EILAFAVcJoJ74C7UE2ER4DHpLBGPaWhslgr7k0rp/Y8QWAhDYioCbS0B1xX8r3PiBAAQg4IfAm+Px+LHmcN7f3x8+3N3VHAK+KxI4nX5a0fvhcDz+RVX/OK9LQPpTu9TUPxeXgI6n0+OzMjUWokuAh1Pnv1Zp3f/hUDcBaN1Z/3bjvzsDqLb+D13s3dzc1JKeR79uLgEJBqVlAvrL6fzpqHddnV5pUZv0r6z1Nxiq0w12K3qvOh2zcsm+HWMLgW0JeNE7NwlA+L1A2TYU8HYmIIHWS4/RWtG+nppKxd2E3MRdf2ynujRRaN/6dm8fi9Wl9u0YWwhsR8CTzrlKAFoCT3C2Cwk8vfwjO+OhR2JVUnG3OnsEV09V3XYvRY4lirSNJYq0rmtKgUAFAt70zV0C0Jp4g1QhThp0aUKuM3o7S5fw6wfyhsQ9bS90ekQ3F/xL9tWWAoFtCHjUNZcJQMvhEdY2YdKyFxNyO7sXCxNy+xZwTdzHJorUfsu8mftWBLzqmdsEoIXxCm2roGnPz6WzdL4FtBcH+5qxZx1znQAUBp7h7StMvcyGbwFeVoJxLCfgXb/cJwAtgXeIy8MEC88E0m8BenJHRd8CVNJIsJ/tSC/nWDur0+WivN0l+4/G+QcCRQmk0VrUcEFjIRKA5hsBZsF1adiUntqx1b594mBP99i+qi052D0C1dm3h7Sd9bVEcMm++lIgUI6ARXA5i+tYCpMANP0oUNdZqlas2tm7hF1n8Cp2Zm8CLxFP26mNhF4RoqeG0vZ6qkgJQWf+Kmk/s38+wr8QKEEgkk6FSgBanEhwSwRTWzauCfuQiJvop98ITOy
  220. "text/plain": [
  221. "<PIL.Image.Image image mode=RGBA size=384x384>"
  222. ]
  223. },
  224. "metadata": {},
  225. "output_type": "display_data"
  226. },
  227. {
  228. "name": "stdout",
  229. "output_type": "stream",
  230. "text": [
  231. "The shield for shield_value = 1.0\n",
  232. "Training with shield:\n"
  233. ]
  234. },
  235. {
  236. "data": {
  237. "image/png": "iVBORw0KGgoAAAANSUh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dvzFiDwEILEXAzS2gtuK/FG78QAACEPBD4MV+v3/Xcjiv7+93b+7uWg4B3w0JHA4/aeh9t9vv/6qpf5y3JSD9aV1a6p+LW0D7w+H4rEyLhUgJcHdI/luVrfvf7domAK0767/d+E9XAM3W/yHF3s3NTSvpOfp1cwtIMChbJqC/nC6fjnqV6rTlRW3yv7LW32CoTl+wW9Fr1emclXP27Rx7CCxLwIveuUkAwu8FyrKhgLcTAQm0Nj1Ga0XHemoqF3cTchN3/bGd6vJEoWPrm14ei9Xl9u0cewgsR8CTzrlKAFoCT3CWCwk8Pf0jO+OhR2JVcnG3OnsEV09V3aZNkWOJIm9jiSKvS00pEGhAwJu+uUsAWhNvkBrEyQZdmpDrit6u0iX8+oG8PnHP2wudHtEtBf+cfbWlQGAZAh51zWUC0HJ4hLVMmGzZiwm5Xd2LhQm5fQq4JO5DE0Vuf8u8mftSBLzqmdsEoIXxCm2poNmen3NX6XwK2F4crGvGnnXMdQJQGHiGt64w9TIbPgV4WQnGcT0B7/rlPgFoCbxDvD5MsPCBQP4pQE/uqOhTgEoeCfazHfntHGtndbpdVLY7Z/9onH8gUJVAHq1VDVc0FiIBaL4RYFZclw2b0lM7ttq3jxzs6R47VrUlB/uOQHX26SFvZ30tEZyzr74UCNQjYBFcz+I8lsIkAE0/CtR5lmorVu3qXcKuK3gVu7I3gZeI5+3URkKvCNFTQ3l7PVWkhKArf5W8n9k/neFfCNQgEEmnQiUALU4kuDWCaVs2Lgl7n4ib6Oe
  238. "text/plain": [
  239. "<PIL.Image.Image image mode=RGBA size=384x384>"
  240. ]
  241. },
  242. "metadata": {},
  243. "output_type": "display_data"
  244. },
  245. {
  246. "name": "stdout",
  247. "output_type": "stream",
  248. "text": [
  249. "Using cpu device\n",
  250. "Wrapping the env with a `Monitor` wrapper\n",
  251. "Wrapping the env in a DummyVecEnv.\n",
  252. "Wrapping the env in a VecTransposeImage.\n",
  253. "-----------------------------------\n",
  254. "| info/ | |\n",
  255. "| no_shield_action | 0 |\n",
  256. "| sum_opened_door | 0 |\n",
  257. "| sum_picked_up | 0 |\n",
  258. "| sum_ran_into_lava | 0 |\n",
  259. "| sum_reached_goal | 2 |\n",
  260. "| rollout/ | |\n",
  261. "| ep_len_mean | 186 |\n",
  262. "| ep_rew_mean | 0.2 |\n",
  263. "| time/ | |\n",
  264. "| fps | 194 |\n",
  265. "| iterations | 1 |\n",
  266. "| time_elapsed | 10 |\n",
  267. "| total_timesteps | 2048 |\n",
  268. "-----------------------------------\n"
  269. ]
  270. }
  271. ],
  272. "source": [
  273. "GRID_TO_PRISM_BINARY=os.getenv(\"M2P_BINARY\")\n",
  274. "import gymnasium as gym\n",
  275. "\n",
  276. "\n",
  277. "def mask_fn(env: gym.Env):\n",
  278. " return env.create_action_mask()\n",
  279. "\n",
  280. "def nomask_fn(env: gym.Env):\n",
  281. " return [1.0] * 7\n",
  282. "\n",
  283. "def main():\n",
  284. " # Edit 'environments/Minigrid/minigrid/envs/Playground.py' to alter the environment\n",
  285. " env = \"MiniGrid-Playground-v0\"\n",
  286. "\n",
  287. " # TODO Change the safety specification\n",
  288. " formula = \"Pmax=? [G !AgentIsOnLava]\"\n",
  289. " value_for_training = 1.0\n",
  290. " shield_comparison = \"absolute\"\n",
  291. " shielding = ShieldingConfig.Training\n",
  292. " \n",
  293. " logger = Logger(\"/tmp\", output_formats=[HumanOutputFormat(sys.stdout)])\n",
  294. " \n",
  295. "\n",
  296. " env = gym.make(env, render_mode=\"rgb_array\")\n",
  297. " image_env = RGBImgObsWrapper(env, TILE_PIXELS)\n",
  298. " env = RGBImgObsWrapper(env, 8)\n",
  299. " env = ImgObsWrapper(env)\n",
  300. " env = MiniWrapper(env)\n",
  301. "\n",
  302. " \n",
  303. " env.reset()\n",
  304. " Image.fromarray(env.render()).show()\n",
  305. " \n",
  306. " shield_handlers = dict()\n",
  307. " if shield_needed(shielding):\n",
  308. " for value in [0.9, 0.99, 0.999, 0.9999, 1.0]:\n",
  309. " 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",
  310. " env = MiniGridSbShieldingWrapper(env, shield_handler=shield_handler, create_shield_at_reset=False)\n",
  311. " create_shield_overlay_image(image_env, shield_handler.create_shield())\n",
  312. " print(f\"The shield for shield_value = {value}\")\n",
  313. "\n",
  314. " shield_handlers[value] = shield_handler\n",
  315. "\n",
  316. "\n",
  317. " if shielding == ShieldingConfig.Training:\n",
  318. " env = MiniGridSbShieldingWrapper(env, shield_handler=shield_handler, create_shield_at_reset=False)\n",
  319. " env = ActionMasker(env, mask_fn)\n",
  320. " print(\"Training with shield:\")\n",
  321. " create_shield_overlay_image(image_env, shield_handlers[value_for_training].create_shield())\n",
  322. " elif shielding == ShieldingConfig.Disabled:\n",
  323. " env = ActionMasker(env, nomask_fn)\n",
  324. " else:\n",
  325. " assert(False) \n",
  326. " model = MaskablePPO(\"CnnPolicy\", env, verbose=1, device=\"auto\")\n",
  327. " model.set_logger(logger)\n",
  328. " steps = 20_000\n",
  329. "\n",
  330. " \n",
  331. " model.learn(steps,callback=[InfoCallback()])\n",
  332. "\n",
  333. "\n",
  334. "\n",
  335. "if __name__ == '__main__':\n",
  336. " print(\"Starting the training\")\n",
  337. " main()"
  338. ]
  339. },
  340. {
  341. "cell_type": "code",
  342. "execution_count": null,
  343. "metadata": {},
  344. "outputs": [],
  345. "source": []
  346. }
  347. ],
  348. "metadata": {
  349. "kernelspec": {
  350. "display_name": "Python 3 (ipykernel)",
  351. "language": "python",
  352. "name": "python3"
  353. },
  354. "language_info": {
  355. "codemirror_mode": {
  356. "name": "ipython",
  357. "version": 3
  358. },
  359. "file_extension": ".py",
  360. "mimetype": "text/x-python",
  361. "name": "python",
  362. "nbconvert_exporter": "python",
  363. "pygments_lexer": "ipython3",
  364. "version": "3.10.12"
  365. }
  366. },
  367. "nbformat": 4,
  368. "nbformat_minor": 4
  369. }