gr-libs 0.1.3__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 (62) hide show
  1. evaluation/analyze_results_cross_alg_cross_domain.py +277 -0
  2. evaluation/create_minigrid_map_image.py +34 -0
  3. evaluation/file_system.py +42 -0
  4. evaluation/generate_experiments_results.py +92 -0
  5. evaluation/generate_experiments_results_new_ver1.py +254 -0
  6. evaluation/generate_experiments_results_new_ver2.py +331 -0
  7. evaluation/generate_task_specific_statistics_plots.py +272 -0
  8. evaluation/get_plans_images.py +47 -0
  9. evaluation/increasing_and_decreasing_.py +63 -0
  10. gr_libs/__init__.py +2 -0
  11. gr_libs/environment/__init__.py +0 -0
  12. gr_libs/environment/environment.py +227 -0
  13. gr_libs/environment/utils/__init__.py +0 -0
  14. gr_libs/environment/utils/utils.py +17 -0
  15. gr_libs/metrics/__init__.py +0 -0
  16. gr_libs/metrics/metrics.py +224 -0
  17. gr_libs/ml/__init__.py +6 -0
  18. gr_libs/ml/agent.py +56 -0
  19. gr_libs/ml/base/__init__.py +1 -0
  20. gr_libs/ml/base/rl_agent.py +54 -0
  21. gr_libs/ml/consts.py +22 -0
  22. gr_libs/ml/neural/__init__.py +3 -0
  23. gr_libs/ml/neural/deep_rl_learner.py +395 -0
  24. gr_libs/ml/neural/utils/__init__.py +2 -0
  25. gr_libs/ml/neural/utils/dictlist.py +33 -0
  26. gr_libs/ml/neural/utils/penv.py +57 -0
  27. gr_libs/ml/planner/__init__.py +0 -0
  28. gr_libs/ml/planner/mcts/__init__.py +0 -0
  29. gr_libs/ml/planner/mcts/mcts_model.py +330 -0
  30. gr_libs/ml/planner/mcts/utils/__init__.py +2 -0
  31. gr_libs/ml/planner/mcts/utils/node.py +33 -0
  32. gr_libs/ml/planner/mcts/utils/tree.py +102 -0
  33. gr_libs/ml/sequential/__init__.py +1 -0
  34. gr_libs/ml/sequential/lstm_model.py +192 -0
  35. gr_libs/ml/tabular/__init__.py +3 -0
  36. gr_libs/ml/tabular/state.py +21 -0
  37. gr_libs/ml/tabular/tabular_q_learner.py +453 -0
  38. gr_libs/ml/tabular/tabular_rl_agent.py +126 -0
  39. gr_libs/ml/utils/__init__.py +6 -0
  40. gr_libs/ml/utils/env.py +7 -0
  41. gr_libs/ml/utils/format.py +100 -0
  42. gr_libs/ml/utils/math.py +13 -0
  43. gr_libs/ml/utils/other.py +24 -0
  44. gr_libs/ml/utils/storage.py +127 -0
  45. gr_libs/recognizer/__init__.py +0 -0
  46. gr_libs/recognizer/gr_as_rl/__init__.py +0 -0
  47. gr_libs/recognizer/gr_as_rl/gr_as_rl_recognizer.py +102 -0
  48. gr_libs/recognizer/graml/__init__.py +0 -0
  49. gr_libs/recognizer/graml/gr_dataset.py +134 -0
  50. gr_libs/recognizer/graml/graml_recognizer.py +266 -0
  51. gr_libs/recognizer/recognizer.py +46 -0
  52. gr_libs/recognizer/utils/__init__.py +1 -0
  53. gr_libs/recognizer/utils/format.py +13 -0
  54. gr_libs-0.1.3.dist-info/METADATA +197 -0
  55. gr_libs-0.1.3.dist-info/RECORD +62 -0
  56. gr_libs-0.1.3.dist-info/WHEEL +5 -0
  57. gr_libs-0.1.3.dist-info/top_level.txt +3 -0
  58. tutorials/graml_minigrid_tutorial.py +30 -0
  59. tutorials/graml_panda_tutorial.py +32 -0
  60. tutorials/graml_parking_tutorial.py +38 -0
  61. tutorials/graml_point_maze_tutorial.py +43 -0
  62. tutorials/graql_minigrid_tutorial.py +29 -0
@@ -0,0 +1,277 @@
1
+ import copy
2
+ import sys
3
+ import matplotlib.pyplot as plt
4
+ import numpy as np
5
+ import os
6
+ import dill
7
+ from scipy.interpolate import make_interp_spline
8
+ from scipy.ndimage import gaussian_filter1d
9
+ from gr_libs.ml.utils.storage import get_experiment_results_path, set_global_storage_configs
10
+ from scripts.generate_task_specific_statistics_plots import get_figures_dir_path
11
+
12
+ def smooth_line(x, y, num_points=300):
13
+ x_smooth = np.linspace(np.min(x), np.max(x), num_points)
14
+ spline = make_interp_spline(x, y, k=3) # Cubic spline
15
+ y_smooth = spline(x_smooth)
16
+ return x_smooth, y_smooth
17
+
18
+ if __name__ == "__main__":
19
+
20
+ fragmented_accuracies = {
21
+ 'graml': {
22
+ 'panda': {'gd_agent': {
23
+ '0.3': [], # every list here should have number of tasks accuracies in it, since we done experiments for L111-L555. remember each accuracy is an average of #goals different tasks.
24
+ '0.5': [],
25
+ '0.7': [],
26
+ '0.9': [],
27
+ '1' : []
28
+ },
29
+ 'gc_agent': {
30
+ '0.3': [],
31
+ '0.5': [],
32
+ '0.7': [],
33
+ '0.9': [],
34
+ '1' : []
35
+ }},
36
+ 'minigrid': {'obstacles': {
37
+ '0.3': [],
38
+ '0.5': [],
39
+ '0.7': [],
40
+ '0.9': [],
41
+ '1' : []
42
+ },
43
+ 'lava_crossing': {
44
+ '0.3': [],
45
+ '0.5': [],
46
+ '0.7': [],
47
+ '0.9': [],
48
+ '1' : []
49
+ }},
50
+ 'point_maze': {'obstacles': {
51
+ '0.3': [],
52
+ '0.5': [],
53
+ '0.7': [],
54
+ '0.9': [],
55
+ '1' : []
56
+ },
57
+ 'four_rooms': {
58
+ '0.3': [],
59
+ '0.5': [],
60
+ '0.7': [],
61
+ '0.9': [],
62
+ '1' : []
63
+ }},
64
+ 'parking': {'gd_agent': {
65
+ '0.3': [],
66
+ '0.5': [],
67
+ '0.7': [],
68
+ '0.9': [],
69
+ '1' : []
70
+ },
71
+ 'gc_agent': {
72
+ '0.3': [],
73
+ '0.5': [],
74
+ '0.7': [],
75
+ '0.9': [],
76
+ '1' : []
77
+ }},
78
+ },
79
+ 'graql': {
80
+ 'panda': {'gd_agent': {
81
+ '0.3': [],
82
+ '0.5': [],
83
+ '0.7': [],
84
+ '0.9': [],
85
+ '1' : []
86
+ },
87
+ 'gc_agent': {
88
+ '0.3': [],
89
+ '0.5': [],
90
+ '0.7': [],
91
+ '0.9': [],
92
+ '1' : []
93
+ }},
94
+ 'minigrid': {'obstacles': {
95
+ '0.3': [],
96
+ '0.5': [],
97
+ '0.7': [],
98
+ '0.9': [],
99
+ '1' : []
100
+ },
101
+ 'lava_crossing': {
102
+ '0.3': [],
103
+ '0.5': [],
104
+ '0.7': [],
105
+ '0.9': [],
106
+ '1' : []
107
+ }},
108
+ 'point_maze': {'obstacles': {
109
+ '0.3': [],
110
+ '0.5': [],
111
+ '0.7': [],
112
+ '0.9': [],
113
+ '1' : []
114
+ },
115
+ 'four_rooms': {
116
+ '0.3': [],
117
+ '0.5': [],
118
+ '0.7': [],
119
+ '0.9': [],
120
+ '1' : []
121
+ }},
122
+ 'parking': {'gd_agent': {
123
+ '0.3': [],
124
+ '0.5': [],
125
+ '0.7': [],
126
+ '0.9': [],
127
+ '1' : []
128
+ },
129
+ 'gc_agent': {
130
+ '0.3': [],
131
+ '0.5': [],
132
+ '0.7': [],
133
+ '0.9': [],
134
+ '1' : []
135
+ }},
136
+ }
137
+ }
138
+
139
+ continuing_accuracies = copy.deepcopy(fragmented_accuracies)
140
+
141
+ #domains = ['panda', 'minigrid', 'point_maze', 'parking']
142
+ domains = ['minigrid', 'point_maze', 'parking']
143
+ tasks = ['L111', 'L222', 'L333', 'L444', 'L555']
144
+ percentages = ['0.3', '0.5', '1']
145
+
146
+ for partial_obs_type, accuracies, is_same_learn in zip(['fragmented', 'continuing'], [fragmented_accuracies, continuing_accuracies], [False, True]):
147
+ for domain in domains:
148
+ for env in accuracies['graml'][domain].keys():
149
+ for task in tasks:
150
+ set_global_storage_configs(recognizer_str='graml', is_fragmented=partial_obs_type,
151
+ is_inference_same_length_sequences=True, is_learn_same_length_sequences=is_same_learn)
152
+ graml_res_file_path = f'{get_experiment_results_path(domain, env, task)}.pkl'
153
+ set_global_storage_configs(recognizer_str='graql', is_fragmented=partial_obs_type)
154
+ graql_res_file_path = f'{get_experiment_results_path(domain, env, task)}.pkl'
155
+ if os.path.exists(graml_res_file_path):
156
+ with open(graml_res_file_path, 'rb') as results_file:
157
+ results = dill.load(results_file)
158
+ for percentage in accuracies['graml'][domain][env].keys():
159
+ accuracies['graml'][domain][env][percentage].append(results[percentage]['accuracy'])
160
+ else:
161
+ assert(False, f"no file for {graml_res_file_path}")
162
+ if os.path.exists(graql_res_file_path):
163
+ with open(graql_res_file_path, 'rb') as results_file:
164
+ results = dill.load(results_file)
165
+ for percentage in accuracies['graml'][domain][env].keys():
166
+ accuracies['graql'][domain][env][percentage].append(results[percentage]['accuracy'])
167
+ else:
168
+ assert(False, f"no file for {graql_res_file_path}")
169
+
170
+ plot_styles = {
171
+ ('graml', 'fragmented', 0.3): 'g--o', # Green dashed line with circle markers
172
+ ('graml', 'fragmented', 0.5): 'g--s', # Green dashed line with square markers
173
+ ('graml', 'fragmented', 0.7): 'g--^', # Green dashed line with triangle-up markers
174
+ ('graml', 'fragmented', 0.9): 'g--d', # Green dashed line with diamond markers
175
+ ('graml', 'fragmented', 1.0): 'g--*', # Green dashed line with star markers
176
+
177
+ ('graml', 'continuing', 0.3): 'g-o', # Green solid line with circle markers
178
+ ('graml', 'continuing', 0.5): 'g-s', # Green solid line with square markers
179
+ ('graml', 'continuing', 0.7): 'g-^', # Green solid line with triangle-up markers
180
+ ('graml', 'continuing', 0.9): 'g-d', # Green solid line with diamond markers
181
+ ('graml', 'continuing', 1.0): 'g-*', # Green solid line with star markers
182
+
183
+ ('graql', 'fragmented', 0.3): 'b--o', # Blue dashed line with circle markers
184
+ ('graql', 'fragmented', 0.5): 'b--s', # Blue dashed line with square markers
185
+ ('graql', 'fragmented', 0.7): 'b--^', # Blue dashed line with triangle-up markers
186
+ ('graql', 'fragmented', 0.9): 'b--d', # Blue dashed line with diamond markers
187
+ ('graql', 'fragmented', 1.0): 'b--*', # Blue dashed line with star markers
188
+
189
+ ('graql', 'continuing', 0.3): 'b-o', # Blue solid line with circle markers
190
+ ('graql', 'continuing', 0.5): 'b-s', # Blue solid line with square markers
191
+ ('graql', 'continuing', 0.7): 'b-^', # Blue solid line with triangle-up markers
192
+ ('graql', 'continuing', 0.9): 'b-d', # Blue solid line with diamond markers
193
+ ('graql', 'continuing', 1.0): 'b-*', # Blue solid line with star markers
194
+ }
195
+
196
+ def average_accuracies(accuracies, domain):
197
+ avg_acc = {algo: {perc: [] for perc in percentages}
198
+ for algo in ['graml', 'graql']}
199
+
200
+ for algo in avg_acc.keys():
201
+ for perc in percentages:
202
+ for env in accuracies[algo][domain].keys():
203
+ env_acc = accuracies[algo][domain][env][perc] # list of 5, averages for L111 to L555.
204
+ if env_acc:
205
+ avg_acc[algo][perc].append(np.array(env_acc))
206
+
207
+ for algo in avg_acc.keys():
208
+ for perc in percentages:
209
+ if avg_acc[algo][perc]:
210
+ avg_acc[algo][perc] = np.mean(np.array(avg_acc[algo][perc]), axis=0)
211
+
212
+ return avg_acc
213
+
214
+ def plot_domain_accuracies(ax, fragmented_accuracies, continuing_accuracies, domain, sigma=1, line_width=1.5):
215
+ fragmented_avg_acc = average_accuracies(fragmented_accuracies, domain)
216
+ continuing_avg_acc = average_accuracies(continuing_accuracies, domain)
217
+
218
+ x_vals = np.arange(1, 6) # Number of goals
219
+
220
+ # Create "waves" (shaded regions) for each algorithm
221
+ for algo in ['graml', 'graql']:
222
+ fragmented_y_vals_by_percentage = []
223
+ continuing_y_vals_by_percentage = []
224
+
225
+ for perc in percentages:
226
+ fragmented_y_vals = np.array(fragmented_avg_acc[algo][perc])
227
+ continuing_y_vals = np.array(continuing_avg_acc[algo][perc])
228
+
229
+ # Smooth the trends using Gaussian filtering
230
+ fragmented_y_smoothed = gaussian_filter1d(fragmented_y_vals, sigma=sigma)
231
+ continuing_y_smoothed = gaussian_filter1d(continuing_y_vals, sigma=sigma)
232
+
233
+ fragmented_y_vals_by_percentage.append(fragmented_y_smoothed)
234
+ continuing_y_vals_by_percentage.append(continuing_y_smoothed)
235
+
236
+ ax.plot(
237
+ x_vals, fragmented_y_smoothed,
238
+ plot_styles[(algo, 'fragmented', float(perc))],
239
+ label=f"{algo}, non-consecutive, {perc}",
240
+ linewidth=0.5 # Control line thickness here
241
+ )
242
+ ax.plot(
243
+ x_vals, continuing_y_smoothed,
244
+ plot_styles[(algo, 'continuing', float(perc))],
245
+ label=f"{algo}, consecutive, {perc}",
246
+ linewidth=0.5 # Control line thickness here
247
+ )
248
+
249
+ ax.set_xticks(x_vals)
250
+ ax.set_yticks(np.linspace(0, 1, 6))
251
+ ax.set_ylim([0, 1])
252
+ ax.set_title(f'{domain.capitalize()} Domain', fontsize=16)
253
+ ax.grid(True)
254
+
255
+ fig, axes = plt.subplots(1, 4, figsize=(24, 6)) # Increase the figure size for better spacing (width 24, height 6)
256
+
257
+ # Generate each plot in a subplot, including both fragmented and continuing accuracies
258
+ for i, domain in enumerate(domains):
259
+ plot_domain_accuracies(axes[i], fragmented_accuracies, continuing_accuracies, domain)
260
+
261
+ # Set a single x-axis and y-axis label for the entire figure
262
+ fig.text(0.5, 0.04, 'Number of Goals', ha='center', fontsize=20) # Centered x-axis label
263
+ fig.text(0.04, 0.5, 'Accuracy', va='center', rotation='vertical', fontsize=20) # Reduced spacing for y-axis label
264
+
265
+ # Adjust subplot layout to avoid overlap
266
+ plt.subplots_adjust(left=0.09, right=0.91, top=0.79, bottom=0.21, wspace=0.3) # More space on top (top=0.82)
267
+
268
+ # Place the legend above the plots with more space between legend and plots
269
+ handles, labels = axes[0].get_legend_handles_labels()
270
+ fig.legend(handles, labels, loc='upper center', ncol=4, bbox_to_anchor=(0.5, 1.05), fontsize=12) # Moved above with bbox_to_anchor
271
+
272
+ # Save the figure and show it
273
+ save_dir = os.path.join('figures', 'all_domains_accuracy_plots')
274
+ if not os.path.exists(save_dir):
275
+ os.makedirs(save_dir)
276
+ plt.savefig(os.path.join(save_dir, 'accuracy_plots_smooth.png'), dpi=300)
277
+
@@ -0,0 +1,34 @@
1
+ from minigrid.wrappers import RGBImgPartialObsWrapper, ImgObsWrapper
2
+ import numpy as np
3
+ import gr_libs.ml as ml
4
+ from minigrid.core.world_object import Wall
5
+ #from q_table_plot import save_q_table_plot_image
6
+ from gymnasium.envs.registration import register
7
+
8
+ env_name = "MiniGrid-SimpleCrossingS13N4-DynamicGoal-5x9-v0"
9
+ # create an agent and train it (if it is already trained, it will get q-table from cache)
10
+ agent = ml.TabularQLearner(env_name='MiniGrid-Walls-13x13-v0',problem_name = "MiniGrid-SimpleCrossingS13N4-DynamicGoal-5x9-v0")
11
+ # agent.learn()
12
+
13
+ # save_q_table_plot_image(agent.q_table, 15, 15, (10,7))
14
+
15
+ # add to the steps list the step the trained agent would take on the env in every state according to the q_table
16
+ env = agent.env
17
+ env = RGBImgPartialObsWrapper(env) # Get pixel observations
18
+ env = ImgObsWrapper(env) # Get rid of the 'mission' field
19
+ obs, _ = env.reset() # This now produces an RGB tensor only
20
+
21
+ img = env.get_frame()
22
+
23
+ ####### save image to file
24
+ from PIL import Image
25
+ import numpy as np
26
+
27
+ image_pil = Image.fromarray(np.uint8(img)).convert('RGB')
28
+ image_pil.save(r"{}.png".format(env_name))
29
+
30
+ # ####### show image
31
+ # from gym_minigrid.window import Window
32
+ # window = Window(r"z")
33
+ # window.show_img(img=img)
34
+ # window.close()
@@ -0,0 +1,42 @@
1
+ import os
2
+ import dill
3
+ import random
4
+ import hashlib
5
+ from typing import List
6
+
7
+ def get_observations_path(env_name: str):
8
+ return f"dataset/{env_name}/observations"
9
+
10
+ def get_observations_paths(path: str):
11
+ return [os.path.join(path, file_name) for file_name in os.listdir(path)]
12
+
13
+ def create_partial_observabilities_files(env_name: str, observabilities: List[float]):
14
+ with open(r"dataset/{env_name}/observations/obs1.0.pkl".format(env_name=env_name), "rb") as f:
15
+ step_1_0 = dill.load(f)
16
+
17
+ number_of_items_to_randomize = [int(observability * len(step_1_0)) for observability in observabilities]
18
+ obs = []
19
+ for items_to_randomize in number_of_items_to_randomize:
20
+ obs.append(random.sample(step_1_0, items_to_randomize))
21
+ for index, observability in enumerate(observabilities):
22
+ partial_steps = obs[index]
23
+ file_path = r"dataset/{env_name}/observations/obs{obs}.pkl".format(env_name=env_name, obs=observability)
24
+ with open(file_path, "wb+") as f:
25
+ dill.dump(partial_steps, f)
26
+
27
+ def md5(file_path: str):
28
+ hash_md5 = hashlib.md5()
29
+ with open(file_path, "rb") as f:
30
+ for chunk in iter(lambda: f.read(4096), b""):
31
+ hash_md5.update(chunk)
32
+ return hash_md5.hexdigest()
33
+
34
+ def get_md5(file_path_list: List[str]):
35
+ return [(file_path, md5(file_path=file_path)) for file_path in file_path_list]
36
+
37
+
38
+ def print_md5(file_path_list: List[str]):
39
+ md5_of_observations = get_md5(file_path_list=file_path_list)
40
+ for file_name, file_md5 in md5_of_observations:
41
+ print(f"{file_name}:{file_md5}")
42
+ print("")
@@ -0,0 +1,92 @@
1
+ import copy
2
+ import sys
3
+ import matplotlib.pyplot as plt
4
+ import numpy as np
5
+ import os
6
+ import dill
7
+ from gr_libs.ml.utils.storage import get_experiment_results_path, set_global_storage_configs
8
+ from scripts.generate_task_specific_statistics_plots import get_figures_dir_path
9
+
10
+ def gen_graph(graph_name, x_label_str, tasks, panda_env, minigrid_env, parking_env, maze_env, percentage):
11
+
12
+ fragmented_accuracies = {
13
+ 'graml': {
14
+ #'panda': [],
15
+ #'minigrid': [],
16
+ #'point_maze': [],
17
+ 'parking': []
18
+ },
19
+ 'graql': {
20
+ #'panda': [],
21
+ #'minigrid': [],
22
+ #'point_maze': [],
23
+ 'parking': []
24
+ }
25
+ }
26
+
27
+ continuing_accuracies = copy.deepcopy(fragmented_accuracies)
28
+
29
+ #domains_envs = [('minigrid', minigrid_env), ('point_maze', maze_env), ('parking', parking_env)]
30
+ domains_envs = [('parking', parking_env)]
31
+
32
+ for partial_obs_type, accuracies, is_same_learn in zip(['fragmented', 'continuing'], [fragmented_accuracies, continuing_accuracies], [False, True]):
33
+ for domain, env in domains_envs:
34
+ for task in tasks:
35
+ set_global_storage_configs(recognizer_str='graml', is_fragmented=partial_obs_type,
36
+ is_inference_same_length_sequences=True, is_learn_same_length_sequences=is_same_learn)
37
+ graml_res_file_path = f'{get_experiment_results_path(domain, env, task)}.pkl'
38
+ set_global_storage_configs(recognizer_str='graql', is_fragmented=partial_obs_type)
39
+ graql_res_file_path = f'{get_experiment_results_path(domain, env, task)}.pkl'
40
+ if os.path.exists(graml_res_file_path):
41
+ with open(graml_res_file_path, 'rb') as results_file:
42
+ results = dill.load(results_file)
43
+ accuracies['graml'][domain].append(results[percentage]['accuracy'])
44
+ else:
45
+ assert(False, f"no file for {graml_res_file_path}")
46
+ if os.path.exists(graql_res_file_path):
47
+ with open(graql_res_file_path, 'rb') as results_file:
48
+ results = dill.load(results_file)
49
+ accuracies['graql'][domain].append(results[percentage]['accuracy'])
50
+ else:
51
+ assert(False, f"no file for {graql_res_file_path}")
52
+
53
+ def plot_accuracies(accuracies, partial_obs_type):
54
+ plt.figure(figsize=(10, 6))
55
+ colors = plt.cm.get_cmap('tab10', len(accuracies['graml']) * len(accuracies['graml']['parking']))
56
+
57
+ # Define different line styles for each algorithm
58
+ line_styles = {'graml': '-', 'graql': '--'}
59
+ x_vals = np.arange(3, 8)
60
+ plt.xticks(x_vals)
61
+ plt.yticks(np.linspace(0, 1, 6))
62
+ plt.ylim([0, 1])
63
+ # Plot each domain-env pair's accuracies with different line styles for each algorithm
64
+ for alg in ['graml', 'graql']:
65
+ for idx, (domain, acc_values) in enumerate(accuracies[alg].items()):
66
+ if acc_values and len(acc_values) > 0: # Only plot if there are values
67
+ x_values = np.arange(3, len(acc_values) + 3)
68
+ plt.plot(x_values, acc_values, marker='o', linestyle=line_styles[alg],
69
+ color=colors(idx), label=f"{alg}-{domain}-{partial_obs_type}-{percentage}")
70
+
71
+ # Set labels, title, and grid
72
+ plt.xlabel(x_label_str)
73
+ plt.ylabel('Accuracy')
74
+ plt.grid(True)
75
+
76
+ # Add legend to differentiate between domain-env pairs
77
+ plt.legend()
78
+
79
+ # Save the figure
80
+ fig_path = os.path.join(f"{graph_name}_{partial_obs_type}.png")
81
+ plt.savefig(fig_path)
82
+ print(f"Accuracies figure saved at: {fig_path}")
83
+
84
+ print(f'fragmented_accuracies: {fragmented_accuracies}')
85
+ plot_accuracies(fragmented_accuracies, 'fragmented')
86
+ print(f'continuing_accuracies: {continuing_accuracies}')
87
+ plot_accuracies(continuing_accuracies, 'continuing')
88
+
89
+ if __name__ == "__main__":
90
+ #gen_graph("increasing_base_goals", "Number of base goals", ['L1', 'L2', 'L3', 'L4', 'L5'], panda_env='gd_agent', minigrid_env='obstacles', parking_env='gd_agent', maze_env='obstacles')
91
+ #gen_graph("increasing_dynamic_goals", "Number of dynamic goals", ['L1', 'L2', 'L3', 'L4', 'L5'], panda_env='gc_agent', minigrid_env='lava_crossing', parking_env='gc_agent', maze_env='four_rooms')
92
+ gen_graph("base_problems", "Number of goals", ['L111', 'L222', 'L333', 'L444', 'L555'], panda_env='gd_agent', minigrid_env='obstacles', parking_env='gc_agent', maze_env='obstacles', percentage='0.7')