Skip to content

Commit 77c47fa

Browse files
authored
Merge pull request p-christ#20 from simonalford42/random_episode
fix bug where first episode using Epsilon_Greedy_Exploration is random
2 parents 5cc38ff + 3398e04 commit 77c47fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exploration_strategies/Epsilon_Greedy_Exploration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def perturb_action_for_exploration_purposes(self, action_info):
3333
epsilon = self.get_updated_epsilon_exploration(action_info)
3434

3535

36-
if (random.random() > epsilon or turn_off_exploration) and (episode_number > self.random_episodes_to_run):
36+
if (random.random() > epsilon or turn_off_exploration) and (episode_number >= self.random_episodes_to_run):
3737
return torch.argmax(action_values).item()
3838
return random.randint(0, action_values.shape[1] - 1)
3939

@@ -65,4 +65,4 @@ def add_exploration_rewards(self, reward_info):
6565

6666
def reset(self):
6767
"""Resets the noise process"""
68-
pass
68+
pass

0 commit comments

Comments
 (0)