File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change 92
92
)
93
93
94
94
95
+ # To ensure reproducibility during training, you can fix the random seeds
96
+ # by uncommenting the lines below. This makes the results consistent across
97
+ # runs, which is helpful for debugging or comparing different approaches.
98
+ #
99
+ # That said, allowing randomness can be beneficial in practice, as it lets
100
+ # the model explore different training trajectories.
101
+
102
+
103
+ # seed = 42
104
+ # random.seed(seed)
105
+ # torch.manual_seed(seed)
106
+ # env.reset(seed=seed)
107
+ # env.action_space.seed(seed)
108
+ # env.observation_space.seed(seed)
109
+ # if torch.cuda.is_available():
110
+ # torch.cuda.manual_seed(seed)
111
+
112
+
95
113
######################################################################
96
114
# Replay Memory
97
115
# -------------
@@ -253,13 +271,15 @@ def forward(self, x):
253
271
# EPS_DECAY controls the rate of exponential decay of epsilon, higher means a slower decay
254
272
# TAU is the update rate of the target network
255
273
# LR is the learning rate of the ``AdamW`` optimizer
274
+
256
275
BATCH_SIZE = 128
257
276
GAMMA = 0.99
258
277
EPS_START = 0.9
259
- EPS_END = 0.05
260
- EPS_DECAY = 1000
278
+ EPS_END = 0.01
279
+ EPS_DECAY = 2500
261
280
TAU = 0.005
262
- LR = 1e-4
281
+ LR = 3e-4
282
+
263
283
264
284
# Get number of actions from gym action space
265
285
n_actions = env .action_space .n
You can’t perform that action at this time.
0 commit comments