Skip to content

League evaluation for partial observable environments#63

Draft
xluox wants to merge 2 commits intomasterfrom
PO_League_Evaluation
Draft

League evaluation for partial observable environments#63
xluox wants to merge 2 commits intomasterfrom
PO_League_Evaluation

Conversation

@xluox
Copy link
Contributor

@xluox xluox commented Feb 24, 2022

This pr includes changes that support multiple maps in league evaluation and evaluation during training. This change has some code dedicated to partially observable training.
Some changes may not fit in the current system since the recent PRs.
Need review to extract the useful portion to merge into master

xluox and others added 2 commits December 16, 2021 20:52
@xluox xluox requested a review from vwxyzjn February 24, 2022 02:43
Copy link
Collaborator

@vwxyzjn vwxyzjn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @xluox thanks for preparing the PR. I have left some comments on which components should be kept. To make it easier, I also suggest making a new branch off of the latest master and including these components.

help='if toggled, the database will be updated')
parser.add_argument('--cuda', type=lambda x: bool(strtobool(x)), default=True, nargs='?', const=True,
help='if toggled, cuda will not be enabled by default')
parser.add_argument('--maps', nargs='+', default=["maps/16x16/basesWorkers16x16B.xml","maps/16x16/basesWorkers16x16C.xml","maps/16x16/basesWorkers16x16D.xml", "maps/16x16/basesWorkers16x16E.xml", "maps/16x16/basesWorkers16x16F.xml"], # [],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The map-related changes should be incorporated into the master.


class Match:
def __init__(self, partial_obs: bool, match_up=None):
def __init__(self, partial_obs: bool, match_up=None, map_path="maps/16x16/basesWorkers16x16A.xml"):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The map-related changes should be incorporated into the master.

built_in_ais2=None
rl_ai=None
rl_ai2=None
self.map_path = map_path
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The map-related changes should be incorporated into the master.

max_steps=max_steps,
render_theme=2,
ai2s=built_in_ais,
map_paths=["maps/16x16/basesWorkers16x16A.xml"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The map-related changes should be incorporated into the master.

torch.save(agent.state_dict(), f"models/{experiment_name}/{global_step}.pt")
wandb.save(f"models/{experiment_name}/agent.pt", base_path=f"models/{experiment_name}", policy="now")
subprocess.Popen(["python", "new_league.py", "--evals", f"models/{experiment_name}/{global_step}.pt", "--update-db", "false"])
subprocess.Popen(["python", "new_league.py", "--evals", f"models/{experiment_name}/{global_step}.pt", "--update-db", "false", "--partial-obs", str(args.partial_obs)])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be needed

trueskill_df = pd.read_csv("league.csv")
trueskill_step_df = pd.read_csv("league.csv")
trueskill_df = pd.read_csv("po_league.csv")
trueskill_step_df = pd.read_csv("po_league.csv")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't have to worry about this anymore because the new script contains an output path for to CSVs: https://github.com/vwxyzjn/gym-microrts/blob/3d7a42f46efbd39a0b806388b8a445fbee48d00f/experiments/ppo_gridnet.py#L240.

@vwxyzjn vwxyzjn changed the title Po league evaluation League evaluation for partial observable environments Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants