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

Bug fix: fix setting different learning rates between backbone and main model in ACT policy #280

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

thomwolf
Copy link
Member

@thomwolf thomwolf commented Jun 17, 2024

What this does

This pull request fix a bug where we were not identifying the backbone in the filtering of the parameters when specifying the learning rate for the backbone and for the main model.

As a result we were always assigning the main model LR for the back bone instead of the backbone specific LR, lr_backbone.

How it was tested

  • Added ./tests/test_policies.py::test_act_backbone_lr.

How to checkout & try? (for the reviewer)

It can be tested with pytest ./tests/test_policies.py::test_act_backbone_lr


This change is Reviewable

Copy link
Collaborator

@alexander-soare alexander-soare left a comment

Choose a reason for hiding this comment

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

Thanks for this @thomwolf and for adding the test to be sure. I'm wondering if it also makes sense to put an assert in train.py (assert that the param groups have non-zero length, and maybe even that their lengths sum up to the total for the model). I most certainly will be making a habit of this from now on as it is such a sneaky and silent bug.

@thomwolf
Copy link
Member Author

Thanks. I think it's probably quite fine now since we only have the backbone in this script (maybe to be added in other scripts indeed)

@thomwolf
Copy link
Member Author

Feel free to merge whenever is convenient for you

@alexander-soare alexander-soare merged commit 11f1cb5 into main Jun 18, 2024
6 checks passed
@alexander-soare alexander-soare deleted the thomwolf_2024_06_17_fix_backbone_lr branch June 18, 2024 12:31
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.

2 participants