-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Updated PettingZoo+RLlib tutorial #19069
Conversation
Updated the tutorial and added link to the blog post by the PettingZoo team.
@richardliaw @sven1977 could you please merge this when you get a chance? |
@sven1977 @richardliaw could this please be merged? it's been 6 days |
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.
Hey @Rohan138 , thanks for the PR. Could you make these few changes I suggested?
rllib/examples/pettingzoo_env.py
Outdated
|
||
# Train once | ||
trainer.train() | ||
env_name = "pistonball_v4" |
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.
Could we move most of the comments back here? They were quite useful for understanding, why we define certain config keys.
rllib/examples/pettingzoo_env.py
Outdated
test_env = ParallelPettingZooEnv(env_creator({})) | ||
obs_space = test_env.observation_space | ||
act_space = test_env.action_space |
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 don't think we need this anymore. Just use:
multiagent:
policies: {"policy0"}
policy_mapping_fn: ...
rllib/examples/pettingzoo_env.py
Outdated
}, | ||
"gamma": 0.99, | ||
} | ||
return (None, obs_space, act_space, config) |
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.
same as above. I don't think it's needed anymore. Just move the "model" key (and its values) into the main config below. Same for gamma.
@sven1977 Per discussion with @jkterry1, we would prefer to move the pettingzoo example so that it links to the example in PettingZoo/tutorials. This way, we can maintain it to keep it compatible with both PettingZoo and RLlib. I've removed the outdated pettingzoo_env.py example and updated the docs accordingly for your review. There's also a Medium article on PettingZoo+RLlib that might be a useful link. |
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.
Looks good now, sorry for the delay. Was out last week and last few days.
We may still have to remove the pettingzoo.py script from our BUILD file as it's currently part of our tests. Will take care of it.
Updated the tutorial and added link to the blog post by the PettingZoo team.
Why are these changes needed?
Checks
scripts/format.sh
to lint the changes in this PR.