-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathignition.py
130 lines (111 loc) · 4.01 KB
/
ignition.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/python
# _____________________________________________________________________________
# ----------------
# import libraries
# ----------------
# standard libraries
# -----
from itertools import product
from util.launcher import Launcher
from absl import flags, app
from ml_collections.config_flags import config_flags
# ----------------
# main program
# ----------------
def main(_argv):
print(FLAGS.config)
LOCAL = False
TEST = False
USE_CUDA = True
JOBLIB_PARALLEL_JOBS = 2 # or os.cpu_count() to use all cores
N_SEEDS = 1
launcher = Launcher(exp_name='001',
python_file='main',
project_name='luna',
base_dir='./save/',
n_exps=N_SEEDS,
joblib_n_jobs=JOBLIB_PARALLEL_JOBS,
n_cores=JOBLIB_PARALLEL_JOBS * 1,
memory=5000,
days=3,
hours=0,
minutes=0,
seconds=0,
partition='sleuths',
# conda_env='base',
# reservation='triesch-shared',
# gres='gpu:rtx2080ti:1' if USE_CUDA else None,
gres='gpu:rtx2070super:1' if USE_CUDA else None,
mail='mernst@fias.uni-frankfurt.de',
use_timestamp=True,
use_underscore_argparse=True
)
# actor_learning_rates = [0.0001, 0.001, 0.01]
# critic_learning_rates = [0.0001, 0.001, 0.01]
# # #b_c_list = [11, 12]
# # #boolean_list = [True, False]
# #
# # #launcher.add_default_params(default='b')
# #
# for ac_lr, cr_lr in product(actor_learning_rates, critic_learning_rates):
# # get the default parameters agent and main
# # add experiments directly to the config
# # b/c joblib passes arguments to experiment
# if LOCAL:
# FLAGS.config.agent.sub.actor_lr = ac_lr
# FLAGS.config.agent.sub.critic_lr = cr_lr
# launcher.add_experiment(**FLAGS.config)
# else:
# launcher.add_experiment(**{
# 'config.main.env_name': 'PointMaze1-v0',
# 'config.main.max_timesteps': 5e6,
# 'config.agent.sub.actor_lr': ac_lr,
# 'config.agent.sub.critic_lr': cr_lr,
# 'config.agent.agent_type': 'hiro',
# 'config.agent.subgoal_dim': 3,
# })
#
agent_type = ['flat', 'hiro']
for at in agent_type:
if LOCAL:
pass
else:
launcher.add_experiment(**{
'config.agent.agent_type': at,
# 'config.main.env_name': 'AntMaze-v1',
'config.main.max_timesteps': 5e6,
# 'config.agent.sub.prio_exp_replay': 1,
# 'config.agent.meta.prio_exp_replay': 1,
# 'config.agent.subgoal_dim': 3,
})
# compressor_type = ['enc', 'autoenc']
# for ct in compressor_type:
# if LOCAL:
# pass
# else:
# launcher.add_experiment(**{
# 'config.agent.agent_type': 'baymax',
# 'config.main.max_timesteps': 5e6,
# 'config.agent.compressor.type':ct,
# })
# launcher.add_experiment(**{
# 'config.agent.agent_type': 'hiro',
# 'config.main.max_timesteps': 5e6,
# 'config.agent.subgoal_dim': 15,
# })
#
launcher.run(LOCAL, TEST)
if __name__ == '__main__':
FLAGS = flags.FLAGS
config_flags.DEFINE_config_file('config', default='./config/default.py')
app.run(main)
# _____________________________________________________________________________
# Stick to 80 characters per line
# Use PEP8 Style
# Comment your code
# -----------------
# top-level comment
# -----------------
# medium level comment
# -----
# low level comment