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

MeltingPot Envs with MarlGroupMapType.ONE_GROUP_PER_AGENT #147

Closed
gliese876b opened this issue Nov 25, 2024 · 4 comments · Fixed by #148
Closed

MeltingPot Envs with MarlGroupMapType.ONE_GROUP_PER_AGENT #147

gliese876b opened this issue Nov 25, 2024 · 4 comments · Fixed by #148

Comments

@gliese876b
Copy link
Contributor

I would like to run an experiment with independent learning on a heterogeneous setting where agents get individual and different rewards.

The default setting for group_map for MeltingPot envs is ALL_IN_ONE_GROUP.

When I switch it to ONE_GROUP_PER_AGENT (as suggested by TorchRL's documentation), an error occurs from ‎MeltingPotTask.get_replay_buffer_transforms() as the method creates a transformation with all keys and the transformation is applied to each player's TensorDict where only that player's keys exists. For example, a transformation with keys of "player_0" and "player_1" is being applied to a TensorDict that contains only a key for "player_0".

For the moment, I disabled it.

I think this issue could be solved by making the replay buffer transformations only if the key exists, similar to ExcludeTransform.

@matteobettini
Copy link
Collaborator

Hey thanks for openening this!

I think I got the issue, let me fix it!

@matteobettini
Copy link
Collaborator

Can you check that #148 solves your issue?

@gliese876b
Copy link
Contributor Author

Yeap! That works. Thanks!

@matteobettini
Copy link
Collaborator

matteobettini commented Nov 25, 2024

Cool! right now torchrl main is broken, I'll merge it as soon as i can!

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 a pull request may close this issue.

2 participants