-
Notifications
You must be signed in to change notification settings - Fork 5
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
Runner evo self play annealing, runner smoke tests #169
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,28 @@ | ||
# Runner | ||
# Runners | ||
|
||
## Evo Runner | ||
|
||
The Evo Runner optimizes the first agent using evolutionary learning. | ||
|
||
See [this experiment](https://github.com/akbir/pax/blob/9a01bae33dcb2f812977be388751393f570957e9/pax/conf/experiment/cg/mfos.yaml) for an example of how to configure it. | ||
|
||
## Evo Runner N-Roles | ||
|
||
This runner extends the evo runner to `N > 2` agents by letting the first and second agent assume multiple roles that can be configured via `agent1_roles` and `agent2_roles` in the experiment configuration. | ||
Both agents receive different sets of memories for each role that they assume but share the weights. | ||
|
||
- For heterogeneous games roles can be shuffled for each rollout using the `shuffle_players` flag. | ||
- Using the `self_play_anneal` flag one can anneal the self-play probability from 0 to 1 over the course of the experiment. | ||
|
||
See [this experiment](https://github.com/akbir/pax/blob/bb0e69ef71fd01ec9c85753814ffba3c5cb77935/pax/conf/experiment/rice/shaper_v_ppo.yaml) for an example of how to configure it. | ||
|
||
## Weight sharing Runner | ||
|
||
A simple baseline for MARL experiments is having one agent assume multiple roles and share the weights between them (but not the memory). | ||
In order for this approach to work the observation vector needs to include one entry that indicates the role of the agent (see [Terry et al.](https://arxiv.org/abs/2005.13625v7). | ||
|
||
See [this experiment](https://github.com/akbir/pax/blob/9d3fa62e34279a338c07cffcbf208edc8a95e7ba/pax/conf/experiment/rice/weight_sharing.yaml) for an example of how to configure it. | ||
|
||
## Runner 1 | ||
|
||
Lorem ipsum. | ||
|
||
## Runner 2 | ||
|
||
Lorem ipsum. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# @package _global_ | ||
|
||
# Agents | ||
agent1: 'PPO_memory' | ||
agent_default: 'PPO' | ||
|
||
# Environment | ||
env_id: Cournot | ||
env_type: meta | ||
a: 100 | ||
b: 1 | ||
marginal_cost: 10 | ||
|
||
# Runner | ||
runner: evo_nroles | ||
|
||
# Training | ||
top_k: 5 | ||
popsize: 1000 | ||
num_envs: 4 | ||
num_opps: 1 | ||
num_outer_steps: 300 | ||
num_inner_steps: 1 # One-shot game | ||
num_iters: 1000 | ||
num_devices: 1 | ||
num_steps: '${num_inner_steps}' | ||
|
||
|
||
# PPO agent parameters | ||
ppo_default: | ||
num_minibatches: 4 | ||
num_epochs: 2 | ||
gamma: 0.96 | ||
gae_lambda: 0.95 | ||
ppo_clipping_epsilon: 0.2 | ||
value_coeff: 0.5 | ||
clip_value: True | ||
max_gradient_norm: 0.5 | ||
anneal_entropy: False | ||
entropy_coeff_start: 0.02 | ||
entropy_coeff_horizon: 2000000 | ||
entropy_coeff_end: 0.001 | ||
lr_scheduling: False | ||
learning_rate: 1 | ||
adam_epsilon: 1e-5 | ||
with_memory: True | ||
with_cnn: False | ||
hidden_size: 16 | ||
|
||
|
||
# ES parameters | ||
es: | ||
algo: OpenES # [OpenES, CMA_ES] | ||
sigma_init: 0.04 # Initial scale of isotropic Gaussian noise | ||
sigma_decay: 0.999 # Multiplicative decay factor | ||
sigma_limit: 0.01 # Smallest possible scale | ||
init_min: 0.0 # Range of parameter mean initialization - Min | ||
init_max: 0.0 # Range of parameter mean initialization - Max | ||
clip_min: -1e10 # Range of parameter proposals - Min | ||
clip_max: 1e10 # Range of parameter proposals - Max | ||
lrate_init: 0.01 # Initial learning rate | ||
lrate_decay: 0.9999 # Multiplicative decay factor | ||
lrate_limit: 0.001 # Smallest possible lrate | ||
beta_1: 0.99 # Adam - beta_1 | ||
beta_2: 0.999 # Adam - beta_2 | ||
eps: 1e-8 # eps constant, | ||
centered_rank: False # Fitness centered_rank | ||
w_decay: 0 # Decay old elite fitness | ||
maximise: True # Maximise fitness | ||
z_score: False # Normalise fitness | ||
mean_reduce: True # Remove mean | ||
|
||
# Logging setup | ||
wandb: | ||
project: cournot | ||
group: 'shaper' | ||
name: 'cournot-SHAPER-${num_players}p-seed-${seed}' | ||
log: True | ||
|
||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Added brief docs on some of the runners