-
Notifications
You must be signed in to change notification settings - Fork 1
Optmiziations to run faster #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| for t_idx in self.t_idxes: | ||
| tm = self.get_teammate_from_idx(t_idx) | ||
| if type(tm) != CustomAgent: | ||
| # if not isinstance(tm, CustomAgent): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are good to not have this comment.
| HOW_LONG=20 | ||
| NUM_OF_CKPOINTS=40 | ||
| LAYOUT_NAMES="c4_v2" | ||
| EXP_DIR=${LAYOUT_NAMES} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should EXP_DIR be ${LAYOUT_NAMES}/${NUM_PLAYER}, instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just an experiment that I decided to run this way. For the final experiments we can set them be layout_names/num_player
| HOW_LONG=20 | ||
| NUM_OF_CKPOINTS=40 | ||
| LAYOUT_NAMES="counter_circuit,coordination_ring,cramped_room,asymmetric_advantages,forced_coordination" | ||
| EXP_DIR="Classic/$NUM_PLAYERS" # When quick_test=True this will be overwritten to "Test/$EXP_DIR" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we want to save agents under a directory, mentioning $NUM_PLAYERS, like this one. Although we have it in this scripts, many scripts do not have EXP_DIR mentioning $NUM_PLAYERS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The directory of best_baseline_experiment is already executed so I am not going to change their scripts. Whenever we add a new script we can follow this template
|
|
||
|
|
||
| def best_EGO(args, add_adv=False) -> None: | ||
| '''for a very specifric experimetn: only for 2 players:: ignore this''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a little typo here. experimetn
Jmiceli17
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Just a few small questions
| self.agent = agent | ||
| self.p_idx = p_idx | ||
| self.env.set_teammates(teammates) | ||
| self.env.set_teammates(teamtype='run_type') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_teammates just checks if teamtype is set right? I think it'd be better to have teamtype=True here then so we don't think there's something special about the 'run_type' string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the difference between this and sandbox/profile_analyze.py? do we need both?
| print("Training agent: " + self.name + ", for experiment: " + experiment_name) | ||
| self.print_tc_helper(self.teammates_collection, "Train TC") | ||
| self.print_tc_helper(self.eval_teammates_collection, "Eval TC") | ||
| self.print_tc_helper(self.eval_envs[0].teammates_collection[TeammatesCollection.EVAL], "Eval TC") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the teammate collections are always going to be uniform?
This PR sets the default computation device to CPU and enables compatibility with SubProcEnv, which allows the code to leverage multiple processes for parallel execution. To support this, the logic for teammate_collection has to be moved to base_overcooked_env.
Currently, the default is configured not to use multiple processes because of memory issues (the higher the n_envs the more memory). Until that is resolved, we continue to use DummyVecEnv by default.