Skip to content

Commit

Permalink
delay deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Oct 26, 2024
1 parent 684027a commit 595b4bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pokemonred_puffer/cleanrl_puffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,17 @@ def evaluate(self):
new_state = random.choice(self.states[new_state_key])
"""
if self.config.train.early_stop:
to_delete = []
for event, minutes in self.config.train.early_stop.values():
if any(event in key for key in self.state.keys()):
del self.config.train.early_stop[event]
to_delete.append(event)
elif self.profile.uptime > minutes * 60 and all(
event not in key for key in self.states.keys()
):
self.early_stop = True
break
for event in to_delete:
del self.config.train.early_stop[event]

# V2 implementation
# check if we have a new highest required_count with N save states available
Expand Down

0 comments on commit 595b4bd

Please sign in to comment.