File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Expand file tree Collapse file tree 1 file changed +17
-9
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 )
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)
103
111
104
112
105
113
######################################################################
You can’t perform that action at this time.
0 commit comments