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

fix sgd bug and add demo notebook #74

Merged
merged 5 commits into from
Oct 27, 2024
Merged

fix sgd bug and add demo notebook #74

merged 5 commits into from
Oct 27, 2024

Conversation

thecharlieblake
Copy link
Contributor

No description provided.

Copy link
Collaborator

@DouglasOrr DouglasOrr left a comment

Choose a reason for hiding this comment

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

A minor query about whether we could use an existing test to verify the new behaviour, but otherwise LGTM.

The notebook is excellent & very clear - thank you for that!

@@ -48,7 +48,7 @@ def test_scaled_parameters(opt: str) -> None:
base_wd = 0.001
param_groups = scaled_parameters(
model.parameters(),
dict(sgd=lr_scale_func_sgd, adam=lr_scale_func_adam)[opt],
dict(sgd=lr_scale_func_sgd("to_output_scale"), adam=lr_scale_func_adam)[opt],
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we should instead change the final layer to a LinearReadout and use this to test the new behaviour?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've done this, and corrected the input scaling rule which I hadn't actually adjusted. It then clicked that in this case it now (of course!) reduces to the adam rules, so I've modified the code to reflect this.

Copy link
Collaborator

@DouglasOrr DouglasOrr left a comment

Choose a reason for hiding this comment

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

Brill, thanks, LGTM!

@thecharlieblake thecharlieblake merged commit bed53b1 into main Oct 27, 2024
1 check passed
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