Skip to content

Commit

Permalink
control async wrapper from config
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Jun 23, 2024
1 parent 05a1488 commit baf7101
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ train:
pool_kernel: [0]
load_optimizer_state: False
use_rnn: True
async_wrapper: False

# swarm_frequency: 500
# swarm_keep_pct: .8
Expand Down
3 changes: 2 additions & 1 deletion pokemonred_puffer/cleanrl_puffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ def evaluate(self):
# their states to the bottom 90%.
# we do this here so the environment can remain "pure"
if (
hasattr(self.config, "swarm_frequency")
self.config.async_wrapper
and hasattr(self.config, "swarm_frequency")
and hasattr(self.config, "swarm_keep_pct")
and self.epoch % self.config.swarm_frequency == 0
and "reward/event" in self.infos
Expand Down
2 changes: 1 addition & 1 deletion pokemonred_puffer/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def train(
args = update_args(args)
args.train.exp_id = f"pokemon-red-{str(uuid.uuid4())[:8]}"

async_wrapper = args.mode == "train"
async_wrapper = args.train.async_wrapper
env_creator = setup_agent(args.wrappers[args.wrappers_name], args.reward_name, async_wrapper)

wandb_client = None
Expand Down

0 comments on commit baf7101

Please sign in to comment.