File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 91
91
"cpu"
92
92
)
93
93
94
+ # set the seeds for reproducibility
95
+ seed = 42
96
+ random .seed (seed )
97
+ torch .manual_seed (seed )
98
+ env .reset (seed = seed )
99
+ env .action_space .seed (seed )
100
+ env .observation_space .seed (seed )
101
+ if torch .cuda .is_available ():
102
+ torch .cuda .manual_seed (seed )
103
+
94
104
95
105
######################################################################
96
106
# Replay Memory
@@ -253,13 +263,14 @@ def forward(self, x):
253
263
# EPS_DECAY controls the rate of exponential decay of epsilon, higher means a slower decay
254
264
# TAU is the update rate of the target network
255
265
# LR is the learning rate of the ``AdamW`` optimizer
266
+
256
267
BATCH_SIZE = 128
257
268
GAMMA = 0.99
258
- EPS_START = 0.9
259
- EPS_END = 0.05
260
- EPS_DECAY = 1000
269
+ EPS_START = 1
270
+ EPS_END = 0.01
271
+ EPS_DECAY = 2500
261
272
TAU = 0.005
262
- LR = 1e -4
273
+ LR = 5e -4
263
274
264
275
# Get number of actions from gym action space
265
276
n_actions = env .action_space .n
You can’t perform that action at this time.
0 commit comments