Skip to content

Commit fe3d2d2

Browse files
author
quintin
committed
fixed default hyperparamters
1 parent 296c7ad commit fe3d2d2

2 files changed

Lines changed: 57 additions & 13 deletions

File tree

‎devel.py‎

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,51 @@
1414
from utils.hyperparameters import Config
1515
from agents.Rainbow import Model
1616

17+
config = Config()
18+
19+
#algorithm control
20+
config.USE_NOISY_NETS=False
21+
config.USE_PRIORITY_REPLAY=False
22+
23+
#Multi-step returns
24+
config.N_STEPS = 1
25+
26+
#epsilon variables
27+
config.epsilon_start = 1.0
28+
config.epsilon_final = 0.01
29+
config.epsilon_decay = 500
30+
config.epsilon_by_frame = lambda frame_idx: config.epsilon_final + (config.epsilon_start - config.epsilon_final) * math.exp(-1. * frame_idx / config.epsilon_decay)
31+
32+
#misc agent variables
33+
config.GAMMA=0.99
34+
config.LR=1e-4
35+
36+
#memory
37+
config.TARGET_NET_UPDATE_FREQ = 128
38+
config.EXP_REPLAY_SIZE = 10000
39+
config.BATCH_SIZE = 32
40+
config.PRIORITY_ALPHA=0.6
41+
config.PRIORITY_BETA_START=0.4
42+
config.PRIORITY_BETA_FRAMES = 100000
43+
44+
#Noisy Nets
45+
config.SIGMA_INIT=0.5
46+
47+
#Learning control variables
48+
config.LEARN_START = config.BATCH_SIZE*2
49+
config.MAX_FRAMES=100000
50+
51+
#Categorical Params
52+
config.ATOMS = 51
53+
config.V_MAX = 50
54+
config.V_MIN = 0
55+
56+
#Quantile Regression Parameters
57+
config.QUANTILES=21
58+
59+
#DRQN Parameters
60+
config.SEQUENCE_LENGTH=8
61+
1762

1863
def plot(frame_idx, rewards, losses, elapsed_time):
1964
#clear_output(True)
@@ -37,7 +82,6 @@ def plot(frame_idx, rewards, losses, elapsed_time):
3782
env = wrap_pytorch(env)'''
3883
env = gym.make('CartPole-v0')
3984
#env = wrappers.Monitor(env, 'Delete', force=True)
40-
config = Config()
4185
model = Model(env=env, config=config)
4286

4387
losses = []

‎utils/hyperparameters.py‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,38 @@ def __init__(self):
1616
#epsilon variables
1717
self.epsilon_start = 1.0
1818
self.epsilon_final = 0.01
19-
self.epsilon_decay = 500
19+
self.epsilon_decay = 30000
2020
self.epsilon_by_frame = lambda frame_idx: self.epsilon_final + (self.epsilon_start - self.epsilon_final) * math.exp(-1. * frame_idx / self.epsilon_decay)
2121

2222
#misc agent variables
2323
self.GAMMA=0.99
2424
self.LR=1e-4
2525

2626
#memory
27-
self.TARGET_NET_UPDATE_FREQ = 256
28-
self.EXP_REPLAY_SIZE = 10000
29-
self.BATCH_SIZE = 128
30-
self.PRIORITY_ALPHA=0.3
27+
self.TARGET_NET_UPDATE_FREQ = 1000
28+
self.EXP_REPLAY_SIZE = 100000
29+
self.BATCH_SIZE = 32
30+
self.PRIORITY_ALPHA=0.6
3131
self.PRIORITY_BETA_START=0.4
32-
self.PRIORITY_BETA_FRAMES = 1000
32+
self.PRIORITY_BETA_FRAMES = 100000
3333

3434
#Noisy Nets
35-
self.SIGMA_INIT=0.2
35+
self.SIGMA_INIT=0.5
3636

3737
#Learning control variables
38-
self.LEARN_START = self.BATCH_SIZE*2
38+
self.LEARN_START = 10000
3939
self.MAX_FRAMES=100000
4040

4141
#Categorical Params
4242
self.ATOMS = 51
43-
self.V_MAX = 50
44-
self.V_MIN = 0
43+
self.V_MAX = 10
44+
self.V_MIN = -10
4545

4646
#Quantile Regression Parameters
47-
self.QUANTILES=11
47+
self.QUANTILES=51
4848

4949
#DRQN Parameters
50-
self.SEQUENCE_LENGTH=10
50+
self.SEQUENCE_LENGTH=8
5151

5252

5353
'''

0 commit comments

Comments
 (0)