-
Notifications
You must be signed in to change notification settings - Fork 313
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
[WIP][Feature] Add support of SMAC environment #810
Conversation
# Conflicts: # test/test_libs.py
# Conflicts: # test/test_libs.py # torchrl/data/__init__.py # torchrl/data/tensor_specs.py
cc @matteobettini @PaLeroy |
This is cool! I am interested in the choice of not adding the agent dimension in the batch_size. Is there a reason for this? |
That was actually the reason I was pinging you on this. @ordinskiy It would be nice if the batch_size matched the number of agents no? |
Thank you for the feedback @matteobettini @vmoens! |
torchrl/envs/libs/smac.py
Outdated
|
||
def _make_observation_spec(self, env: smac.env.StarCraft2Env) -> TensorSpec: | ||
info = env.get_env_info() | ||
size = torch.Size((info["n_agents"], info["obs_shape"])) |
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 Nd specs are doing what we were discussing in #766 (comment)
Aka we are leaking part of the batch_size (agents) into the specs.
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.
If you add the agents to the batch_size, normal specs will likely suffice. But #766 might be helpful for this as well
Nice work! |
I'm going to refactor this using |
printf "* Installing StarCraft 2 and SMAC maps into '${root_dir}/smac/StarCraftII'\n" | ||
mkdir $root_dir/smac | ||
cd $root_dir/smac/ | ||
# TODO: discuss how we can cache it to avoid downloading ~4 GB on each run. |
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.
Needs to figure out how to cache
THIS IS DRAFT COMMIT TO TEST CI AND DISCUSS.
Description
Added support of SMAC (StarCraft Multi-Agent Challenge) environment.
Includes CI and documentation.
New tensor specs came from #56.
Motivation and Context
SMAC is a popular library for research in field of multi-agent reinforcement learning (MARL). Its support was proposed by @vmoens in #509.
Types of changes
What types of changes does your code introduce? Remove all that do not apply:
Checklist
Go over all the following points, and put an
x
in all the boxes that apply.If you are unsure about any of these, don't hesitate to ask. We are here to help!