gr-libs 0.1.6.post1__py3-none-any.whl → 0.1.8__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.
- evaluation/analyze_results_cross_alg_cross_domain.py +236 -246
- evaluation/create_minigrid_map_image.py +10 -6
- evaluation/file_system.py +16 -5
- evaluation/generate_experiments_results.py +123 -74
- evaluation/generate_experiments_results_new_ver1.py +227 -243
- evaluation/generate_experiments_results_new_ver2.py +317 -317
- evaluation/generate_task_specific_statistics_plots.py +481 -253
- evaluation/get_plans_images.py +41 -26
- evaluation/increasing_and_decreasing_.py +97 -56
- gr_libs/__init__.py +6 -1
- gr_libs/_version.py +2 -2
- gr_libs/environment/__init__.py +17 -9
- gr_libs/environment/environment.py +167 -39
- gr_libs/environment/utils/utils.py +22 -12
- gr_libs/metrics/__init__.py +5 -0
- gr_libs/metrics/metrics.py +76 -34
- gr_libs/ml/__init__.py +2 -0
- gr_libs/ml/agent.py +21 -6
- gr_libs/ml/base/__init__.py +1 -1
- gr_libs/ml/base/rl_agent.py +13 -10
- gr_libs/ml/consts.py +1 -1
- gr_libs/ml/neural/deep_rl_learner.py +433 -352
- gr_libs/ml/neural/utils/__init__.py +1 -1
- gr_libs/ml/neural/utils/dictlist.py +3 -3
- gr_libs/ml/neural/utils/penv.py +5 -2
- gr_libs/ml/planner/mcts/mcts_model.py +524 -302
- gr_libs/ml/planner/mcts/utils/__init__.py +1 -1
- gr_libs/ml/planner/mcts/utils/node.py +11 -7
- gr_libs/ml/planner/mcts/utils/tree.py +14 -10
- gr_libs/ml/sequential/__init__.py +1 -1
- gr_libs/ml/sequential/lstm_model.py +256 -175
- gr_libs/ml/tabular/state.py +7 -7
- gr_libs/ml/tabular/tabular_q_learner.py +123 -73
- gr_libs/ml/tabular/tabular_rl_agent.py +20 -19
- gr_libs/ml/utils/__init__.py +8 -2
- gr_libs/ml/utils/format.py +78 -70
- gr_libs/ml/utils/math.py +2 -1
- gr_libs/ml/utils/other.py +1 -1
- gr_libs/ml/utils/storage.py +95 -28
- gr_libs/problems/consts.py +1549 -1227
- gr_libs/recognizer/gr_as_rl/gr_as_rl_recognizer.py +145 -80
- gr_libs/recognizer/graml/gr_dataset.py +209 -110
- gr_libs/recognizer/graml/graml_recognizer.py +431 -231
- gr_libs/recognizer/recognizer.py +38 -27
- gr_libs/recognizer/utils/__init__.py +1 -1
- gr_libs/recognizer/utils/format.py +8 -3
- {gr_libs-0.1.6.post1.dist-info → gr_libs-0.1.8.dist-info}/METADATA +1 -1
- gr_libs-0.1.8.dist-info/RECORD +70 -0
- {gr_libs-0.1.6.post1.dist-info → gr_libs-0.1.8.dist-info}/WHEEL +1 -1
- {gr_libs-0.1.6.post1.dist-info → gr_libs-0.1.8.dist-info}/top_level.txt +0 -1
- tests/test_gcdraco.py +10 -0
- tests/test_graml.py +8 -4
- tests/test_graql.py +2 -1
- tutorials/gcdraco_panda_tutorial.py +66 -0
- tutorials/gcdraco_parking_tutorial.py +61 -0
- tutorials/graml_minigrid_tutorial.py +42 -12
- tutorials/graml_panda_tutorial.py +35 -14
- tutorials/graml_parking_tutorial.py +37 -19
- tutorials/graml_point_maze_tutorial.py +33 -13
- tutorials/graql_minigrid_tutorial.py +31 -15
- CI/README.md +0 -12
- CI/docker_build_context/Dockerfile +0 -15
- gr_libs/recognizer/recognizer_doc.md +0 -61
- gr_libs-0.1.6.post1.dist-info/RECORD +0 -70
@@ -1,2 +1,2 @@
|
|
1
1
|
from gr_libs.ml.neural.utils.dictlist import DictList
|
2
|
-
from gr_libs.ml.neural.utils.penv import ParallelEnv
|
2
|
+
from gr_libs.ml.neural.utils.penv import ParallelEnv
|
@@ -22,12 +22,12 @@ class DictList(dict):
|
|
22
22
|
def __setitem__(self, index, d):
|
23
23
|
for key, value in d.items():
|
24
24
|
dict.__getitem__(self, key)[index] = value
|
25
|
-
|
25
|
+
|
26
26
|
def __reduce__(self):
|
27
27
|
# Custom serialization method for dill
|
28
28
|
return (DictList, (dict(self),)) # Serialize as (DictList, (dict(self),))
|
29
29
|
|
30
30
|
def __setstate__(self, state):
|
31
31
|
# Custom deserialization method for dill
|
32
|
-
data, = state
|
33
|
-
self.update(data)
|
32
|
+
(data,) = state
|
33
|
+
self.update(data)
|
gr_libs/ml/neural/utils/penv.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import multiprocessing
|
2
2
|
import gymnasium as gym
|
3
3
|
|
4
|
-
#multiprocessing.set_start_method("fork")
|
4
|
+
# multiprocessing.set_start_method("fork")
|
5
5
|
|
6
6
|
|
7
7
|
def worker(conn, env):
|
@@ -50,7 +50,10 @@ class ParallelEnv(gym.Env):
|
|
50
50
|
obs, reward, terminated, truncated, info = self.envs[0].step(actions[0])
|
51
51
|
if terminated or truncated:
|
52
52
|
obs, _ = self.envs[0].reset()
|
53
|
-
results = zip(
|
53
|
+
results = zip(
|
54
|
+
*[(obs, reward, terminated, truncated, info)]
|
55
|
+
+ [local.recv() for local in self.locals]
|
56
|
+
)
|
54
57
|
return results
|
55
58
|
|
56
59
|
def render(self):
|