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

feat: set the action head automatically #1104

Merged
merged 4 commits into from
Oct 21, 2024
Merged

feat: set the action head automatically #1104

merged 4 commits into from
Oct 21, 2024

Conversation

WiemKhlifi
Copy link
Contributor

What?

Refactored action head selection to use a dictionary lookup instead of manually setting for each env and network.

Why?

This change eases the process of selecting the appropriate action head for each environment.

How?

Added the get_action_head function as a utility and removed the action_head from all yaml configs.

Copy link
Contributor

@sash-a sash-a left a comment

Choose a reason for hiding this comment

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

Swap to using action specs instead of manually making the dictionary of env -> head 😄

mava/utils/network_utils.py Outdated Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/L and removed size/M labels Oct 18, 2024
@WiemKhlifi WiemKhlifi changed the title feat: set the action head automatically based on env name feat: set the action head automatically Oct 18, 2024
@WiemKhlifi WiemKhlifi self-assigned this Oct 21, 2024
Copy link
Collaborator

@RuanJohn RuanJohn left a comment

Choose a reason for hiding this comment

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

This is a general suggestion so that we can also use this function for the transformer based systems which don't need a head config but need an action space type.

You'd just also need to update the system run files to accommodate for this.

mava/utils/network_utils.py Outdated Show resolved Hide resolved
mava/utils/network_utils.py Show resolved Hide resolved
Copy link
Collaborator

@RuanJohn RuanJohn 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! Thank you @WiemKhlifi 🙌

Copy link
Contributor

@sash-a sash-a left a comment

Choose a reason for hiding this comment

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

🔥

@WiemKhlifi WiemKhlifi merged commit 57c8e64 into develop Oct 21, 2024
4 checks passed
@WiemKhlifi WiemKhlifi deleted the feat/act_head branch October 21, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants