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

fix: small bug in the pettingzoo wrapper related to legal action masking #432

Merged
merged 2 commits into from
Feb 24, 2022

Conversation

jcformanek
Copy link
Contributor

@jcformanek jcformanek commented Feb 24, 2022

What?

The legal action mask in pettingzoo Pong was causing the madqn example to fail. This is because MADQN expects the legal action mask to be a vector of ones and zeros specifying for each action if it is a valid action or not. The pettingzoo wrapper was returning only a single one value for the legal action mask.

Also fixed problem in TicTacToe example. The MADQN executor needs a select_action method for single agents.

Why?

The MADQN example on Pong was failing.

How?

Simple fix in the pettingzoo wrapper.

MADQN needs select_action method for single agents in sequential games like Tic Tac Toe.

Extra

N/A

@jcformanek jcformanek linked an issue Feb 24, 2022 that may be closed by this pull request
@jcformanek
Copy link
Contributor Author

@AsadJeewa see the fixes here.

Copy link
Collaborator

@arnupretorius arnupretorius left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks @jcformanek 👍

We should just benchmark to make sure it is working as expected.

@AsadJeewa
Copy link
Contributor

Thanks for the quick fix @jcformanek

Copy link
Contributor

@AsadJeewa AsadJeewa left a comment

Choose a reason for hiding this comment

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

Looks good and runs on my side without any errors

mava/wrappers/pettingzoo.py Show resolved Hide resolved
mava/systems/tf/madqn/execution.py Show resolved Hide resolved
mava/wrappers/pettingzoo.py Show resolved Hide resolved
@arnupretorius arnupretorius merged commit 1e21726 into develop Feb 24, 2022
@arnupretorius arnupretorius deleted the fix/example-madqn-on-pong branch February 24, 2022 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/M
Projects
None yet
4 participants