-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
45 lines (40 loc) · 1.48 KB
/
main.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
from config import config
import warnings
import os
from itertools import product
from codes.strategy import EGreedyStrategy, EGreedyLinearStrategy
from codes.trainer import trainer
from codes.utills import name_check
warnings.filterwarnings('ignore')
os.environ['KMP_DUPLICATE_LIB_OK']='True'
eg = lambda : EGreedyStrategy(epsilon=0.001)
egl = lambda: EGreedyLinearStrategy(init_epsilon=1.0,
min_epsilon=0.001,
decay_steps=15000*24)
SEEDS = [12] # 12, 34, 53, 44, 34, 53
def run():
st_list = [egl] # eg
batch_list = [32]
model_name = ["PER"] # "DQN", "PER", "DDQN", "DualingDDQN", "REMS", "LRDQN"
for seed in SEEDS:
# hyper search
for sub_set in product(*[batch_list, st_list, model_name]):
cfg = config()
batch, train_st, model_= sub_set
print(f"Model : {model_}, batch : {batch}, train_st : {train_st().__class__.__name__}")
if name_check(model_):
return print("모델 이름 이상함")
cfg.seed = seed
cfg.coder = model_
cfg.model.batch_size= batch
cfg.model.training_strategy_fn = train_st
if cfg.coder == 'REMS':
cfg.model.p=0.1
cfg.model.q=0.01
cfg.model.H=5
cfg.model.obs=1
# 모델을 학습
trainer(cfg)
if __name__ == '__main__':
print("train start.........")
run()