-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.py
51 lines (37 loc) · 1.74 KB
/
config.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
class EnvConfig:
ENV = "CartPole-v0"
def get_env_cfg(self, args):
self.ENV = args['env'] if args['env'] else self.ENV
class AgentConfig:
EXPERIMENT_NO = 99
START_EPISODE = 0
NUM_EPISODES = 500
MEMORY_CAPA = 50000
MAX_EPS = 1.0
MIN_EPS = 0.01
UPDATE_FREQ = 10
DEMO_NUM = 100
LR = 5e-4 # learning rate
LR_STEP_SIZE = 9999 # learning rate step size
DECAY_RATE = 0.99 # decay rate
BATCH_SIZE = 32 # batch size
GAMMA = 0.99 # gamma
ALPHA = 0.6 # alpha for PER
BETA = 0.4 # beta for PER
DOUBLE = False # double Q-learning
DUELING = False # dueling network
PER = False # prioritized replay
RES_PATH = './experiments/'
def get_agent_cfg(self, args):
self.EXPERIMENT_NO = args['experiment_num'] if args['experiment_num'] else self.EXPERIMENT_NO
self.LR = args['learning_rate'] if args['learning_rate'] else self.LR
self.DECAY_RATE = args['decay_rate'] if args['decay_rate'] else self.DECAY_RATE
self.BATCH_SIZE = args['batch_size'] if args['batch_size'] else self.BATCH_SIZE
self.NUM_EPISODES = args['num_episodes'] if args['num_episodes'] else self.NUM_EPISODES
self.GAMMA = args['gamma'] if args['gamma'] else self.GAMMA
self.ALPHA = args['alpha'] if args['alpha'] else self.ALPHA
self.BETA = args['beta'] if args['beta'] else self.BETA
self.LR_STEP_SIZE = args['lr_step_size'] if args['lr_step_size'] else self.LR_STEP_SIZE
self.DOUBLE = args['double'] if args['double'] else self.DOUBLE
self.DUELING = args['dueling'] if args['dueling'] else self.DUELING
self.PER = args['per'] if args['per'] else self.PER