Skip to content
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

TransfQMix release #58

Merged
merged 25 commits into from
Feb 14, 2024
Merged

TransfQMix release #58

merged 25 commits into from
Feb 14, 2024

Conversation

mttga
Copy link
Collaborator

@mttga mttga commented Feb 12, 2024

No description provided.

@mttga mttga requested a review from amacrutherford February 12, 2024 17:17
Copy link
Collaborator

@amacrutherford amacrutherford left a comment

Choose a reason for hiding this comment

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

looks cool! couple of minor points, also would be interesting to see the SMAX results

Copy link
Collaborator

Choose a reason for hiding this comment

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

need to remove this no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh yes true, will do

Copy link
Collaborator

Choose a reason for hiding this comment

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

will each env need an if clause in __init__? maybe worth putting a note if so

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes every env that wants to use trasformers will need to wrap the environment observations in some way to be readable by the transformer. I could also reorganize it to have per-env specific wrappers if that would look better. I had put a note on the readme but now I see I deleted by mistake

Copy link
Collaborator

Choose a reason for hiding this comment

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

why not just import from flax?

Copy link
Collaborator Author

@mttga mttga Feb 13, 2024

Choose a reason for hiding this comment

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

the multihead attention from the fastattention script is significantly faster and more stable than the default flax one, which is beneficial in RL.

The script was taken in https://github.com/google-research/google-research/blob/master/performer/fast_attention/jax/fast_attention.py

Notice that the use of fast attention is optional:

https://github.com/FLAIROx/JaxMARL/blob/4d78674dc5195683f3cd6e7e9d6799ddd586a714/baselines/QLearning/transf_qmix.py#L51C9-L72C14

return train


def signle_run(config):
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes 🙃 thanks

@mttga
Copy link
Collaborator Author

mttga commented Feb 13, 2024

Here are the results average across 4 seeds:

Results are better than QMix for most of the maps with except of 3s5z and 3s5z_vs_3s_6z. But the main advantage of transformers is the potential transferability of the agent parameters and the learned qmix function between scenarios.

Copy link
Collaborator

Choose a reason for hiding this comment

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

why we removing the hanabi option?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That was a preliminary way to create a global state vector for Hanabi. I realized that including the players' hands wasn't adding any new information, since those hands are already represented within the concatenated agent observations.

Copy link
Collaborator

Choose a reason for hiding this comment

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

cools !

@amacrutherford
Copy link
Collaborator

Here are the results average across 4 seeds:

* test won: https://api.wandb.ai/links/mttga/2beham1m

* test returns: https://api.wandb.ai/links/mttga/6yszv25o

Results are better than QMix for most of the maps with except of 3s5z and 3s5z_vs_3s_6z. But the main advantage of transformers is the potential transferability of the agent parameters and the learned qmix function between scenarios.

awesome!

@amacrutherford amacrutherford merged commit 602616f into main Feb 14, 2024
6 checks passed
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