diff --git a/eval_experiments.py b/eval_experiments.py index a30fbe0..6eb47b1 100644 --- a/eval_experiments.py +++ b/eval_experiments.py @@ -6,7 +6,7 @@ import json activations = [torch.nn.Tanh, torch.nn.LeakyReLU] -def main(method:str='expert', folder:str=None, locations=[(0,0)], skip_running=False, save_videos:bool=False, videos_folder:str='videos'): +def main(method:str='expert', folder:str=None, locations=[(0,0)], skip_running=False, save_videos:bool=False, videos_folder:str='videos', first_seed_only:bool=False): exclude_keys_from_policy_kwargs = {'learning_rate', 'learning_rate_decay', 'clip_ratio', 'iterations_per_epoch', 'option'} policy_kwargs = {} @@ -30,8 +30,13 @@ def main(method:str='expert', folder:str=None, locations=[(0,0)], skip_running=F if folder is not None: files = [os.path.join(folder, f) for f in os.listdir(folder) if os.path.isfile(os.path.join(folder, f))] files = [f for f in files if f.endswith('.pt')] + + if first_seed_only: + files = files[:1] + with open(os.path.join(folder, 'config.json'), 'rb') as f: config = json.load(f) + print('%i policy files found in %s folder' %(len(files), folder)) print('found policy config', config['policy']) diff --git a/generate_videos.sh b/generate_videos.sh index 49f1103..9233d8d 100755 --- a/generate_videos.sh +++ b/generate_videos.sh @@ -3,18 +3,18 @@ # Experiment A python -m eval_experiments -python -m eval_experiments --method expert_agent --save_videos -python -m eval_experiments --method idm --save_videos -python -m eval_experiments --method bc --folder='test_policies/bc/expA' --save_videos -python -m eval_experiments --method gail --folder='test_policies/gail/expA' --save_videos -python -m eval_experiments --method hail --folder='test_policies/hail/expA' --save_videos -python -m eval_experiments --method shail --folder='test_policies/shail/expA' --save_videos +python -m eval_experiments --method expert_agent --save_videos --first_seed_only +python -m eval_experiments --method idm --save_videos --first_seed_only +python -m eval_experiments --method bc --folder='test_policies/bc/expA' --save_videos --first_seed_only +python -m eval_experiments --method gail --folder='test_policies/gail/expA' --save_videos --first_seed_only +python -m eval_experiments --method hail --folder='test_policies/hail/expA' --save_videos --first_seed_only +python -m eval_experiments --method shail --folder='test_policies/shail/expA' --save_videos --first_seed_only # Experiment B python -m eval_experiments --locations='[(0,4)]' -python -m eval_experiments --method expert_agent --locations='[(0,4)]' --save_videos -python -m eval_experiments --method idm --locations='[(0,4)]' --save_videos -python -m eval_experiments --method bc --folder='test_policies/bc/expB' --locations='[(0,4)]' --save_videos -python -m eval_experiments --method gail --folder='test_policies/gail/expB' --locations='[(0,4)]' --save_videos -python -m eval_experiments --method hail --folder='test_policies/hail/expB' --locations='[(0,4)]' --save_videos -python -m eval_experiments --method shail --folder='test_policies/shail/expB' --locations='[(0,4)]' --save_videos +python -m eval_experiments --method expert_agent --locations='[(0,4)]' --save_videos --first_seed_only +python -m eval_experiments --method idm --locations='[(0,4)]' --save_videos --first_seed_only +python -m eval_experiments --method bc --folder='test_policies/bc/expB' --locations='[(0,4)]' --save_videos --first_seed_only +python -m eval_experiments --method gail --folder='test_policies/gail/expB' --locations='[(0,4)]' --save_videos --first_seed_only +python -m eval_experiments --method hail --folder='test_policies/hail/expB' --locations='[(0,4)]' --save_videos --first_seed_only +python -m eval_experiments --method shail --folder='test_policies/shail/expB' --locations='[(0,4)]' --save_videos --first_seed_only