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

[Question] Why does fixed weight decay support only "one cylce" lr scheduler? #21

Closed
s-ryosky opened this issue Jan 3, 2020 · 1 comment

Comments

@s-ryosky
Copy link
Contributor

s-ryosky commented Jan 3, 2020

In SECOND's repo adam optimizer with fixed weight decay is supported on all lr scheduler.
However, in this repo fixed weight decay is supported on only "one cycle" lr scheduler.
Why?

def build_one_cycle_optimizer(model, optimizer_config):
    if optimizer_config.fixed_wd:
        optimizer_func = partial(
            torch.optim.Adam, betas=(0.9, 0.99), amsgrad=optimizer_config.amsgrad
        )
    else:
        optimizer_func = partial(torch.optim.Adam, amsgrad=optimizer_cfg.amsgrad)

    optimizer = OptimWrapper.create(
        optimizer_func,
        3e-3,
        get_layer_groups(model),
        wd=optimizer_config.wd,
        true_wd=optimizer_config.fixed_wd,
        bn_wd=True,
    )

    return optimizer
@poodarchu
Copy link
Collaborator

you can implement it and make a merge request, thanks.

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

No branches or pull requests

2 participants