gr-libs 0.1.8__py3-none-any.whl → 0.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. gr_libs/__init__.py +3 -1
  2. gr_libs/_evaluation/__init__.py +1 -0
  3. evaluation/analyze_results_cross_alg_cross_domain.py → gr_libs/_evaluation/_analyze_results_cross_alg_cross_domain.py +81 -88
  4. evaluation/generate_experiments_results.py → gr_libs/_evaluation/_generate_experiments_results.py +6 -6
  5. evaluation/generate_task_specific_statistics_plots.py → gr_libs/_evaluation/_generate_task_specific_statistics_plots.py +11 -14
  6. evaluation/get_plans_images.py → gr_libs/_evaluation/_get_plans_images.py +3 -4
  7. evaluation/increasing_and_decreasing_.py → gr_libs/_evaluation/_increasing_and_decreasing_.py +3 -1
  8. gr_libs/_version.py +2 -2
  9. gr_libs/all_experiments.py +294 -0
  10. gr_libs/environment/__init__.py +14 -1
  11. gr_libs/environment/{utils → _utils}/utils.py +1 -1
  12. gr_libs/environment/environment.py +257 -22
  13. gr_libs/metrics/__init__.py +2 -0
  14. gr_libs/metrics/metrics.py +166 -31
  15. gr_libs/ml/__init__.py +1 -6
  16. gr_libs/ml/base/__init__.py +3 -1
  17. gr_libs/ml/base/rl_agent.py +68 -3
  18. gr_libs/ml/neural/__init__.py +1 -3
  19. gr_libs/ml/neural/deep_rl_learner.py +227 -67
  20. gr_libs/ml/neural/utils/__init__.py +1 -2
  21. gr_libs/ml/planner/mcts/{utils → _utils}/tree.py +1 -1
  22. gr_libs/ml/planner/mcts/mcts_model.py +71 -34
  23. gr_libs/ml/sequential/__init__.py +0 -1
  24. gr_libs/ml/sequential/{lstm_model.py → _lstm_model.py} +11 -14
  25. gr_libs/ml/tabular/__init__.py +1 -3
  26. gr_libs/ml/tabular/tabular_q_learner.py +27 -9
  27. gr_libs/ml/tabular/tabular_rl_agent.py +22 -9
  28. gr_libs/ml/utils/__init__.py +2 -9
  29. gr_libs/ml/utils/format.py +13 -90
  30. gr_libs/ml/utils/math.py +3 -2
  31. gr_libs/ml/utils/other.py +2 -2
  32. gr_libs/ml/utils/storage.py +41 -94
  33. gr_libs/odgr_executor.py +268 -0
  34. gr_libs/problems/consts.py +2 -2
  35. gr_libs/recognizer/_utils/__init__.py +0 -0
  36. gr_libs/recognizer/{utils → _utils}/format.py +2 -2
  37. gr_libs/recognizer/gr_as_rl/gr_as_rl_recognizer.py +116 -36
  38. gr_libs/recognizer/graml/{gr_dataset.py → _gr_dataset.py} +11 -11
  39. gr_libs/recognizer/graml/graml_recognizer.py +172 -29
  40. gr_libs/recognizer/recognizer.py +59 -10
  41. gr_libs/tutorials/draco_panda_tutorial.py +58 -0
  42. gr_libs/tutorials/draco_parking_tutorial.py +56 -0
  43. {tutorials → gr_libs/tutorials}/gcdraco_panda_tutorial.py +5 -9
  44. {tutorials → gr_libs/tutorials}/gcdraco_parking_tutorial.py +3 -7
  45. {tutorials → gr_libs/tutorials}/graml_minigrid_tutorial.py +2 -2
  46. {tutorials → gr_libs/tutorials}/graml_panda_tutorial.py +5 -10
  47. {tutorials → gr_libs/tutorials}/graml_parking_tutorial.py +5 -9
  48. {tutorials → gr_libs/tutorials}/graml_point_maze_tutorial.py +2 -1
  49. {tutorials → gr_libs/tutorials}/graql_minigrid_tutorial.py +2 -2
  50. {gr_libs-0.1.8.dist-info → gr_libs-0.2.2.dist-info}/METADATA +84 -29
  51. gr_libs-0.2.2.dist-info/RECORD +71 -0
  52. {gr_libs-0.1.8.dist-info → gr_libs-0.2.2.dist-info}/WHEEL +1 -1
  53. gr_libs-0.2.2.dist-info/top_level.txt +2 -0
  54. tests/test_draco.py +14 -0
  55. tests/test_gcdraco.py +2 -2
  56. tests/test_graml.py +4 -4
  57. tests/test_graql.py +1 -1
  58. evaluation/create_minigrid_map_image.py +0 -38
  59. evaluation/file_system.py +0 -53
  60. evaluation/generate_experiments_results_new_ver1.py +0 -238
  61. evaluation/generate_experiments_results_new_ver2.py +0 -331
  62. gr_libs/ml/neural/utils/penv.py +0 -60
  63. gr_libs/recognizer/utils/__init__.py +0 -1
  64. gr_libs-0.1.8.dist-info/RECORD +0 -70
  65. gr_libs-0.1.8.dist-info/top_level.txt +0 -4
  66. /gr_libs/environment/{utils → _utils}/__init__.py +0 -0
  67. /gr_libs/ml/planner/mcts/{utils → _utils}/__init__.py +0 -0
  68. /gr_libs/ml/planner/mcts/{utils → _utils}/node.py +0 -0
@@ -1,60 +0,0 @@
1
- import multiprocessing
2
- import gymnasium as gym
3
-
4
- # multiprocessing.set_start_method("fork")
5
-
6
-
7
- def worker(conn, env):
8
- while True:
9
- cmd, data = conn.recv()
10
- if cmd == "step":
11
- obs, reward, terminated, truncated, info = env.step(data)
12
- if terminated or truncated:
13
- obs, _ = env.reset()
14
- conn.send((obs, reward, terminated, truncated, info))
15
- elif cmd == "reset":
16
- obs, _ = env.reset()
17
- conn.send(obs)
18
- else:
19
- raise NotImplementedError
20
-
21
-
22
- class ParallelEnv(gym.Env):
23
- """A concurrent execution of environments in multiple processes."""
24
-
25
- def __init__(self, envs):
26
- assert len(envs) >= 1, "No environment given."
27
-
28
- self.envs = envs
29
- self.observation_space = self.envs[0].observation_space
30
- self.action_space = self.envs[0].action_space
31
-
32
- self.locals = []
33
- for env in self.envs[1:]:
34
- local, remote = multiprocessing.Pipe()
35
- self.locals.append(local)
36
- p = multiprocessing.Process(target=worker, args=(remote, env))
37
- p.daemon = True
38
- p.start()
39
- remote.close()
40
-
41
- def reset(self):
42
- for local in self.locals:
43
- local.send(("reset", None))
44
- results = [self.envs[0].reset()[0]] + [local.recv() for local in self.locals]
45
- return results
46
-
47
- def step(self, actions):
48
- for local, action in zip(self.locals, actions[1:]):
49
- local.send(("step", action))
50
- obs, reward, terminated, truncated, info = self.envs[0].step(actions[0])
51
- if terminated or truncated:
52
- obs, _ = self.envs[0].reset()
53
- results = zip(
54
- *[(obs, reward, terminated, truncated, info)]
55
- + [local.recv() for local in self.locals]
56
- )
57
- return results
58
-
59
- def render(self):
60
- raise NotImplementedError
@@ -1 +0,0 @@
1
- from .format import recognizer_str_to_obj
@@ -1,70 +0,0 @@
1
- evaluation/analyze_results_cross_alg_cross_domain.py,sha256=ioAySQ92yWMg9rNUxy5TQ-viPMTRjIPqBLwYmUIgaCA,11346
2
- evaluation/create_minigrid_map_image.py,sha256=l8MukZBGV63EnEjdGhbdH-9sXR7kTbfPnEzE5ZJkw6w,1257
3
- evaluation/file_system.py,sha256=Asaqq0_4CFVhQ8VyfEuaDBQK3-QkjMJIUfx5SA8y1Co,1645
4
- evaluation/generate_experiments_results.py,sha256=RIlztqGh9OtZg6usLRypEJJdPmZA_M3x6bHi-T0WCxs,5257
5
- evaluation/generate_experiments_results_new_ver1.py,sha256=yGg8MFU-9xwdYsOyZCehGwTvWnwoudN7ctpUOLmi070,10305
6
- evaluation/generate_experiments_results_new_ver2.py,sha256=ERJRuAY446QGOvqRlbUWYELF_fFO4GgOeMcdTXIOvrY,14267
7
- evaluation/generate_task_specific_statistics_plots.py,sha256=IIL-4qSbR2YLih8vvOIkz-poIq7p7_NuEZG1xR10vXw,19126
8
- evaluation/get_plans_images.py,sha256=F2Tez4ZeFsU22R8x0pjeUQ2GMQrpbN6g8XCHDPrz_F8,2730
9
- evaluation/increasing_and_decreasing_.py,sha256=MscBjQwGauBdRoFxgHfLpcd-iu6WqNgmD_iHx4wfh2U,3866
10
- gr_libs/__init__.py,sha256=MpvF14G0wRxRm9dxz97p5JxRhIbAfyFc3MJ1S8YRsNM,297
11
- gr_libs/_version.py,sha256=AjUi5zEL_BoWoXMXR1FnWc3mD6FHX7snDXjDHVLoens,511
12
- gr_libs/environment/__init__.py,sha256=mttRtyD8jXs9qMTjqruKO5JohrFhlS4QPEDYw5Se2MA,1150
13
- gr_libs/environment/environment.py,sha256=4_LbPuIDdPI-yM0wnQFL_xqrC9VOa9Q_8ejkIUKTbvs,10445
14
- gr_libs/environment/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- gr_libs/environment/utils/utils.py,sha256=4K5yy4bs-dNRsfl3KUctQw4Kx-lzYuN_8JzI-xxk_Ng,630
16
- gr_libs/metrics/__init__.py,sha256=cNIyyAB4YJHAG5wzIh8ZW1792vYrt6iW9i2mkBJUa9Q,110
17
- gr_libs/metrics/metrics.py,sha256=Yj3qYRAyrQeTxHK_shIjrgAKic4vMibK6ClyKavTzZ0,9016
18
- gr_libs/ml/__init__.py,sha256=r2SBzpSNpR6wynSn_npew8CCz0E_PBwQbuBGWFfIKRQ,235
19
- gr_libs/ml/agent.py,sha256=ea1yRltKX0LSpRMnpAQLRKvvKoLMQz9MgMeWBPhQISw,2095
20
- gr_libs/ml/consts.py,sha256=vsEB1nk5V_qP3FjNlv4vBKeTTFngV3RNaNp6fWnmEz0,366
21
- gr_libs/ml/base/__init__.py,sha256=nofgF53Gho5KlAV6BWTi0jfQACDynp6bq3kctm1R6aM,69
22
- gr_libs/ml/base/rl_agent.py,sha256=OIrcdtgSHk7ZcUdSyQHbPnwU9T1SqGRQkOzx5rSt8LY,1600
23
- gr_libs/ml/neural/__init__.py,sha256=g-0D5oFX8W52To4OR8vO8kDoBLSxAupVqwcQw8XjT5E,180
24
- gr_libs/ml/neural/deep_rl_learner.py,sha256=mv89WoCCGHcrnyEOzHldCMlQeUyAIbGoYHMQmahzM0w,21808
25
- gr_libs/ml/neural/utils/__init__.py,sha256=xbJ40_o7rTrzS9LXidjurGaRMdMjvSUnXsTjbJf9kR8,107
26
- gr_libs/ml/neural/utils/dictlist.py,sha256=ORFez_KmaCzraStF97hxdgCAAALP4Er8u3e9RcqlvhM,1030
27
- gr_libs/ml/neural/utils/penv.py,sha256=v_yy2E05ZyspH-95trnjB0es10A2i13iBr3Zub_goZA,1897
28
- gr_libs/ml/planner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- gr_libs/ml/planner/mcts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- gr_libs/ml/planner/mcts/mcts_model.py,sha256=zbYKhb_49iS2I9Tgh7NtAf1iwM5lH6ZC3y3-uDvr40I,26466
31
- gr_libs/ml/planner/mcts/utils/__init__.py,sha256=0ccEf23-6VIenUSrlVFCq0VNVDkCHHNzBw7jR09UiO4,46
32
- gr_libs/ml/planner/mcts/utils/node.py,sha256=LcbBjzURMDF4v_Lvz24dyhhW5xb1xQKWdPkue-2lNLM,1056
33
- gr_libs/ml/planner/mcts/utils/tree.py,sha256=49i1ZLYV-9w-lh09Mb4qd3zQ92EqpyYWn5cQA5mo1F0,3409
34
- gr_libs/ml/sequential/__init__.py,sha256=HTtnXxcqxF7e_uPh0--kOhHZtF2YasvgKJDIig38NkM,62
35
- gr_libs/ml/sequential/lstm_model.py,sha256=1MESuStASSTptJ5dWIUyex76o7UNria2yBPoza3sCOo,10868
36
- gr_libs/ml/tabular/__init__.py,sha256=jAfjfTFZLLlVm1KUiJdxdnaNGFp1J2KBU89q_vvradM,177
37
- gr_libs/ml/tabular/state.py,sha256=ImpIrYWF80PB-4EeQ2Q9nO7jMZ2s0hGbgsir1ZtsO88,700
38
- gr_libs/ml/tabular/tabular_q_learner.py,sha256=CSzyN0qVBPFUqiJ_uJSTemh7FddeEJVar4Zu8z2IZ6I,19060
39
- gr_libs/ml/tabular/tabular_rl_agent.py,sha256=JzFgVhiILjhgA_aBbsJYgQaFUPEJOxlHTcsPKrg-h4E,3658
40
- gr_libs/ml/utils/__init__.py,sha256=eYkoOi-rIjxog1ikMqrCmXVOiSP9XHQh66fwWfBsfKs,284
41
- gr_libs/ml/utils/env.py,sha256=AWVN0OXYmFU-J3FUiwvEAIY93Suf1oL6VNcxtyWJraM,171
42
- gr_libs/ml/utils/format.py,sha256=xh2TKzVZsy1XmK8JCk_MJhB5zn37VIHVx060Rd-YqKE,3581
43
- gr_libs/ml/utils/math.py,sha256=4U_F67eS6xuS7fN9hNtZFcFPObmSN2soi-2O3AGVgVs,442
44
- gr_libs/ml/utils/other.py,sha256=QM44H4Bx1ajaz594P23sQ7tJ0JDraABeQSD23ygWf9w,506
45
- gr_libs/ml/utils/storage.py,sha256=a5F-KXRMdGGHPTKSQpGeNRHfZyv9m6j7ZhuLLNNjTvE,4947
46
- gr_libs/problems/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
- gr_libs/problems/consts.py,sha256=tzad2l2DVnQxHen1AS8rPYmGiy02x_53NOrjmv9KL9E,62096
48
- gr_libs/recognizer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
- gr_libs/recognizer/recognizer.py,sha256=Q4EpAQFgahkDMdhm8Dgsu2aRB8EetpxxELtrTuv-ri4,1897
50
- gr_libs/recognizer/gr_as_rl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
- gr_libs/recognizer/gr_as_rl/gr_as_rl_recognizer.py,sha256=LG_nVjujzcmC9euyouTB9CywvCHpuqe4CPB8jTlzgfA,6743
52
- gr_libs/recognizer/graml/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
- gr_libs/recognizer/graml/gr_dataset.py,sha256=c0-n4kzMQN78DUQV_7egz_oyHC9EMmmYixMRA2DFO3k,10106
54
- gr_libs/recognizer/graml/graml_recognizer.py,sha256=qm6kdRX8HpKOb6S3D_8oWj6HA4pzk1jnsA9BekTOKyE,19867
55
- gr_libs/recognizer/utils/__init__.py,sha256=MvXPRyr30W5C_n-Dul3aheE_9SWy2aIMGINKWj36mfM,42
56
- gr_libs/recognizer/utils/format.py,sha256=O1NbaZ_3bgl5jKgcGwdA0R1NWGm9Ha0EG6mHJcivpTY,512
57
- tests/test_gcdraco.py,sha256=o4badhWKXMhysPVt0a2jjvKDR-mfzt5KqyRyIutZnS0,292
58
- tests/test_graml.py,sha256=1h9LjRbss_fpqViDX7KBjLKfu4EZstREOnVHQCDJct4,576
59
- tests/test_graql.py,sha256=VM6o6wHuf2y76YQo7pbBrerbBZe4MwYv9sFvj1Y-nZ0,146
60
- tutorials/gcdraco_panda_tutorial.py,sha256=hfZ--4Q0JEwFTnmZ9PStIhJxk3fHAgnP1XhE_Mq4nS4,2287
61
- tutorials/gcdraco_parking_tutorial.py,sha256=iWhfRGFFqUXUEKNXEWww1SIoEIo8dJ8GOp5FzFfAlKE,2097
62
- tutorials/graml_minigrid_tutorial.py,sha256=eHNe5G5gMktWb-3Z_nHvQP6O5UNbFVQpCp6HUnJsxYQ,2204
63
- tutorials/graml_panda_tutorial.py,sha256=8zpPyoA8GI0bTjGI3mKCBW2eZwlZ2dQ5NNtVcg9t5rU,2241
64
- tutorials/graml_parking_tutorial.py,sha256=EuQ_j1KqJmMaFEgINvNSlSe6TKkL3XP-mh0M0ZC6IIA,2011
65
- tutorials/graml_point_maze_tutorial.py,sha256=dgvz1qnE6k2YOE_5dyRDF8MQYRAuLGYcdpvi-NiNoSs,2186
66
- tutorials/graql_minigrid_tutorial.py,sha256=pznoOcO8PU-VwfH9sxlJBOQskmilfrHg9nky1m2Adz0,1940
67
- gr_libs-0.1.8.dist-info/METADATA,sha256=-DZi3tJBEZF7hdoh6L5PRWycjIihDp4iKVALsBM7VME,9614
68
- gr_libs-0.1.8.dist-info/WHEEL,sha256=GHB6lJx2juba1wDgXDNlMTyM13ckjBMKf-OnwgKOCtA,91
69
- gr_libs-0.1.8.dist-info/top_level.txt,sha256=fJQF8Q8Dfh_D3pA2mhNodazNjzW6b3oWfnx6Jdo-pBU,35
70
- gr_libs-0.1.8.dist-info/RECORD,,
@@ -1,4 +0,0 @@
1
- evaluation
2
- gr_libs
3
- tests
4
- tutorials
File without changes
File without changes
File without changes