Skip to content

Fixing controller data alignment within padded actions tensor.#46

Open
z80 wants to merge 2 commits intoMineDojo:mainfrom
z80:fix_action_alignment
Open

Fixing controller data alignment within padded actions tensor.#46
z80 wants to merge 2 commits intoMineDojo:mainfrom
z80:fix_action_alignment

Conversation

@z80
Copy link

@z80 z80 commented Mar 26, 2026

Hello MineDojo,

I believe, there is a controller data alignment issue in mm_tokenizers.py file. In encode() controller data is aligned left and padded with zeros on the right. But in the decode() the data is assumed to be aligned right as negative indices are used to extract j_right, j_left, and buttons.
When controller inputs are recovered after integrating noise data in get_action()/get_action_with_cfg(), the action tensor last dimension is 25, not 21. Quick and dirty fix is to add one line

actions = actions[:, :, :21]

prior to extracting j_left, j_right, and buttons.

Thank you!

@loicmagne
Copy link
Collaborator

Hi @z80 , I don't think this is correct, as said in #43 , while the model only uses 16 buttons and 4 joystick axes, it was still trained on 21 buttons and 4 joystick axes for legacy reasons. Given that max_action_dim=25, there is no padding happening in practice

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 this pull request may close these issues.

3 participants