From da6d1d812ce820b46cf728c6c21134d9d6780e79 Mon Sep 17 00:00:00 2001 From: ebuehrle <43623224+ebuehrle@users.noreply.github.com> Date: Mon, 28 Feb 2022 10:33:10 +0100 Subject: [PATCH 1/4] Add some configs --- best_configs/hail-etienne2_expA.json | 33 ++++++++++++++++++++++++++++ best_configs/hail-etienne2_expB.json | 33 ++++++++++++++++++++++++++++ best_configs/hail-etienne3_expA.json | 33 ++++++++++++++++++++++++++++ best_configs/hail-etienne3_expB.json | 33 ++++++++++++++++++++++++++++ 4 files changed, 132 insertions(+) create mode 100644 best_configs/hail-etienne2_expA.json create mode 100644 best_configs/hail-etienne2_expB.json create mode 100644 best_configs/hail-etienne3_expA.json create mode 100644 best_configs/hail-etienne3_expB.json diff --git a/best_configs/hail-etienne2_expA.json b/best_configs/hail-etienne2_expA.json new file mode 100644 index 0000000..a43762d --- /dev/null +++ b/best_configs/hail-etienne2_expA.json @@ -0,0 +1,33 @@ +{ + "experiment": "A", + "trainenv": { + "stop_on_collision": false, + "safe_actions_collision_method": null, + "abort_unsafe_collision_method": null + }, + "policy": { + "learning_rate": 0.0003, + "learning_rate_decay": 1.0, + "clip_ratio": 0.2, + "iterations_per_epoch": 100, + "hidden_layer_size": 10, + "n_hidden_layers": 3, + "activation": 0, + "option": 0 + }, + "value": { + "learning_rate": 0.001, + "iterations_per_epoch": 1000 + }, + "discriminator": { + "learning_rate": 0.001, + "weight_decay": 0.0001, + "iterations_per_epoch": 100, + "n_hidden_layers_element": 3, + "n_hidden_layers_global": 2, + "hidden_layer_size": 10, + "activation": 0 + }, + "train_epochs": 100, + "seed": 0 +} \ No newline at end of file diff --git a/best_configs/hail-etienne2_expB.json b/best_configs/hail-etienne2_expB.json new file mode 100644 index 0000000..6425d4f --- /dev/null +++ b/best_configs/hail-etienne2_expB.json @@ -0,0 +1,33 @@ +{ + "experiment": "B", + "trainenv": { + "stop_on_collision": false, + "safe_actions_collision_method": null, + "abort_unsafe_collision_method": null + }, + "policy": { + "learning_rate": 0.0003, + "learning_rate_decay": 1.0, + "clip_ratio": 0.2, + "iterations_per_epoch": 100, + "hidden_layer_size": 10, + "n_hidden_layers": 3, + "activation": 0, + "option": 0 + }, + "value": { + "learning_rate": 0.001, + "iterations_per_epoch": 1000 + }, + "discriminator": { + "learning_rate": 0.001, + "weight_decay": 0.0001, + "iterations_per_epoch": 100, + "n_hidden_layers_element": 3, + "n_hidden_layers_global": 2, + "hidden_layer_size": 10, + "activation": 0 + }, + "train_epochs": 100, + "seed": 0 +} \ No newline at end of file diff --git a/best_configs/hail-etienne3_expA.json b/best_configs/hail-etienne3_expA.json new file mode 100644 index 0000000..91775ab --- /dev/null +++ b/best_configs/hail-etienne3_expA.json @@ -0,0 +1,33 @@ +{ + "experiment": "A", + "trainenv": { + "stop_on_collision": false, + "safe_actions_collision_method": null, + "abort_unsafe_collision_method": null + }, + "policy": { + "learning_rate": 0.0003, + "learning_rate_decay": 1.0, + "clip_ratio": 0.2, + "iterations_per_epoch": 100, + "hidden_layer_size": 40, + "n_hidden_layers": 3, + "activation": 0, + "option": 0 + }, + "value": { + "learning_rate": 0.001, + "iterations_per_epoch": 1000 + }, + "discriminator": { + "learning_rate": 0.001, + "weight_decay": 0.0001, + "iterations_per_epoch": 100, + "n_hidden_layers_element": 3, + "n_hidden_layers_global": 2, + "hidden_layer_size": 10, + "activation": 0 + }, + "train_epochs": 100, + "seed": 0 +} \ No newline at end of file diff --git a/best_configs/hail-etienne3_expB.json b/best_configs/hail-etienne3_expB.json new file mode 100644 index 0000000..c75cfb5 --- /dev/null +++ b/best_configs/hail-etienne3_expB.json @@ -0,0 +1,33 @@ +{ + "experiment": "B", + "trainenv": { + "stop_on_collision": false, + "safe_actions_collision_method": null, + "abort_unsafe_collision_method": null + }, + "policy": { + "learning_rate": 0.0003, + "learning_rate_decay": 1.0, + "clip_ratio": 0.2, + "iterations_per_epoch": 100, + "hidden_layer_size": 40, + "n_hidden_layers": 3, + "activation": 0, + "option": 0 + }, + "value": { + "learning_rate": 0.001, + "iterations_per_epoch": 1000 + }, + "discriminator": { + "learning_rate": 0.001, + "weight_decay": 0.0001, + "iterations_per_epoch": 100, + "n_hidden_layers_element": 3, + "n_hidden_layers_global": 2, + "hidden_layer_size": 10, + "activation": 0 + }, + "train_epochs": 100, + "seed": 0 +} \ No newline at end of file From 57076793c1414777b1ebe9d18cf6756ff81f09d8 Mon Sep 17 00:00:00 2001 From: ebuehrle <43623224+ebuehrle@users.noreply.github.com> Date: Mon, 28 Feb 2022 10:43:12 +0100 Subject: [PATCH 2/4] Add configs for SHAIL --- best_configs/shail-etienne2_expA.json | 33 +++++++++++++++++++++++++++ best_configs/shail-etienne2_expB.json | 33 +++++++++++++++++++++++++++ best_configs/shail-etienne3_expA.json | 33 +++++++++++++++++++++++++++ best_configs/shail-etienne3_expB.json | 33 +++++++++++++++++++++++++++ 4 files changed, 132 insertions(+) create mode 100644 best_configs/shail-etienne2_expA.json create mode 100644 best_configs/shail-etienne2_expB.json create mode 100644 best_configs/shail-etienne3_expA.json create mode 100644 best_configs/shail-etienne3_expB.json diff --git a/best_configs/shail-etienne2_expA.json b/best_configs/shail-etienne2_expA.json new file mode 100644 index 0000000..a3f6b90 --- /dev/null +++ b/best_configs/shail-etienne2_expA.json @@ -0,0 +1,33 @@ +{ + "experiment": "A", + "trainenv": { + "stop_on_collision": false, + "safe_actions_collision_method": "circle", + "abort_unsafe_collision_method": "circle" + }, + "policy": { + "learning_rate": 0.0003, + "learning_rate_decay": 1.0, + "clip_ratio": 0.2, + "iterations_per_epoch": 100, + "hidden_layer_size": 10, + "n_hidden_layers": 3, + "activation": 0, + "option": 0 + }, + "value": { + "learning_rate": 0.001, + "iterations_per_epoch": 1000 + }, + "discriminator": { + "learning_rate": 0.001, + "weight_decay": 0.0001, + "iterations_per_epoch": 100, + "n_hidden_layers_element": 3, + "n_hidden_layers_global": 2, + "hidden_layer_size": 10, + "activation": 0 + }, + "train_epochs": 100, + "seed": 0 +} \ No newline at end of file diff --git a/best_configs/shail-etienne2_expB.json b/best_configs/shail-etienne2_expB.json new file mode 100644 index 0000000..096f2ea --- /dev/null +++ b/best_configs/shail-etienne2_expB.json @@ -0,0 +1,33 @@ +{ + "experiment": "B", + "trainenv": { + "stop_on_collision": false, + "safe_actions_collision_method": "circle", + "abort_unsafe_collision_method": "circle" + }, + "policy": { + "learning_rate": 0.0003, + "learning_rate_decay": 1.0, + "clip_ratio": 0.2, + "iterations_per_epoch": 100, + "hidden_layer_size": 10, + "n_hidden_layers": 3, + "activation": 0, + "option": 0 + }, + "value": { + "learning_rate": 0.001, + "iterations_per_epoch": 1000 + }, + "discriminator": { + "learning_rate": 0.001, + "weight_decay": 0.0001, + "iterations_per_epoch": 100, + "n_hidden_layers_element": 3, + "n_hidden_layers_global": 2, + "hidden_layer_size": 10, + "activation": 0 + }, + "train_epochs": 100, + "seed": 0 +} \ No newline at end of file diff --git a/best_configs/shail-etienne3_expA.json b/best_configs/shail-etienne3_expA.json new file mode 100644 index 0000000..385d63d --- /dev/null +++ b/best_configs/shail-etienne3_expA.json @@ -0,0 +1,33 @@ +{ + "experiment": "A", + "trainenv": { + "stop_on_collision": false, + "safe_actions_collision_method": "circle", + "abort_unsafe_collision_method": "circle" + }, + "policy": { + "learning_rate": 0.0003, + "learning_rate_decay": 1.0, + "clip_ratio": 0.2, + "iterations_per_epoch": 100, + "hidden_layer_size": 40, + "n_hidden_layers": 3, + "activation": 0, + "option": 0 + }, + "value": { + "learning_rate": 0.001, + "iterations_per_epoch": 1000 + }, + "discriminator": { + "learning_rate": 0.001, + "weight_decay": 0.0001, + "iterations_per_epoch": 100, + "n_hidden_layers_element": 3, + "n_hidden_layers_global": 2, + "hidden_layer_size": 10, + "activation": 0 + }, + "train_epochs": 100, + "seed": 0 +} \ No newline at end of file diff --git a/best_configs/shail-etienne3_expB.json b/best_configs/shail-etienne3_expB.json new file mode 100644 index 0000000..d0d0b69 --- /dev/null +++ b/best_configs/shail-etienne3_expB.json @@ -0,0 +1,33 @@ +{ + "experiment": "B", + "trainenv": { + "stop_on_collision": false, + "safe_actions_collision_method": "circle", + "abort_unsafe_collision_method": "circle" + }, + "policy": { + "learning_rate": 0.0003, + "learning_rate_decay": 1.0, + "clip_ratio": 0.2, + "iterations_per_epoch": 100, + "hidden_layer_size": 40, + "n_hidden_layers": 3, + "activation": 0, + "option": 0 + }, + "value": { + "learning_rate": 0.001, + "iterations_per_epoch": 1000 + }, + "discriminator": { + "learning_rate": 0.001, + "weight_decay": 0.0001, + "iterations_per_epoch": 100, + "n_hidden_layers_element": 3, + "n_hidden_layers_global": 2, + "hidden_layer_size": 10, + "activation": 0 + }, + "train_epochs": 100, + "seed": 0 +} \ No newline at end of file From 8cc71f07de3af3a4a05ea0498e3a3e94370f998d Mon Sep 17 00:00:00 2001 From: ebuehrle <43623224+ebuehrle@users.noreply.github.com> Date: Mon, 28 Feb 2022 10:45:19 +0100 Subject: [PATCH 3/4] Configure HAIL in eval script --- evaluate_models.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evaluate_models.sh b/evaluate_models.sh index 8ec9a15..85c0add 100755 --- a/evaluate_models.sh +++ b/evaluate_models.sh @@ -8,8 +8,8 @@ python -m eval_experiments --method bc --folder='test_policies/bc/expA' python -m eval_experiments --method bc --folder='test_policies/bc/expB' --locations='[(0,4)]' python -m eval_experiments --method gail --folder='test_policies/gail/expA' python -m eval_experiments --method gail --folder='test_policies/gail/expB' --locations='[(0,4)]' -python -m eval_experiments --method hail --folder='test_policies/hail/expA' -python -m eval_experiments --method hail --folder='test_policies/hail/expB' --locations='[(0,4)]' +python -m eval_experiments --method hail --folder='test_policies/hail/expA' --env_kwargs='{safe_actions_collision_method=None,abort_unsafe_collision_method=None}' +python -m eval_experiments --method hail --folder='test_policies/hail/expB' --locations='[(0,4)]' --env_kwargs='{safe_actions_collision_method=None,abort_unsafe_collision_method=None}' python -m eval_experiments --method shail --folder='test_policies/shail/expA' python -m eval_experiments --method shail --folder='test_policies/shail/expB' --locations='[(0,4)]' From 51eb810f5ca339e20167e7eafd4a49ee519f2151 Mon Sep 17 00:00:00 2001 From: ebuehrle <43623224+ebuehrle@users.noreply.github.com> Date: Mon, 28 Feb 2022 10:52:26 +0100 Subject: [PATCH 4/4] COnfigure HAIL in eval_experiments --- eval_experiments.py | 2 +- evaluate_models.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eval_experiments.py b/eval_experiments.py index 3eed2ed..f9f1c8e 100644 --- a/eval_experiments.py +++ b/eval_experiments.py @@ -12,7 +12,7 @@ def main(method:str='expert', folder:str=None, locations=[(0,0)], skip_running=F env_kwargs={'stop_on_collision':True, 'max_episode_steps':1000} elif method in ['hail']: env = 'NormalizedOptionsEvalEnv' - env_kwargs={'stop_on_collision':True, 'max_episode_steps':1000} + env_kwargs={'stop_on_collision':True, 'max_episode_steps':1000, 'safe_actions_collision_method': None, 'abort_unsafe_collision_method': None} elif method in ['shail']: env = 'NormalizedSafeOptionsEvalEnv' env_kwargs={'stop_on_collision':True, 'max_episode_steps':1000} diff --git a/evaluate_models.sh b/evaluate_models.sh index 85c0add..8ec9a15 100755 --- a/evaluate_models.sh +++ b/evaluate_models.sh @@ -8,8 +8,8 @@ python -m eval_experiments --method bc --folder='test_policies/bc/expA' python -m eval_experiments --method bc --folder='test_policies/bc/expB' --locations='[(0,4)]' python -m eval_experiments --method gail --folder='test_policies/gail/expA' python -m eval_experiments --method gail --folder='test_policies/gail/expB' --locations='[(0,4)]' -python -m eval_experiments --method hail --folder='test_policies/hail/expA' --env_kwargs='{safe_actions_collision_method=None,abort_unsafe_collision_method=None}' -python -m eval_experiments --method hail --folder='test_policies/hail/expB' --locations='[(0,4)]' --env_kwargs='{safe_actions_collision_method=None,abort_unsafe_collision_method=None}' +python -m eval_experiments --method hail --folder='test_policies/hail/expA' +python -m eval_experiments --method hail --folder='test_policies/hail/expB' --locations='[(0,4)]' python -m eval_experiments --method shail --folder='test_policies/shail/expA' python -m eval_experiments --method shail --folder='test_policies/shail/expB' --locations='[(0,4)]'