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

Make optional warmup_end_value in create_lr_scheduler_with_warmup #855

Closed
vfdev-5 opened this issue Mar 29, 2020 · 0 comments · Fixed by #859
Closed

Make optional warmup_end_value in create_lr_scheduler_with_warmup #855

vfdev-5 opened this issue Mar 29, 2020 · 0 comments · Fixed by #859

Comments

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Mar 29, 2020

🚀 Feature

It would be interesting to setup a lr scheduler without specifying warmup_end_value which can be deduced from provided optimizer:

import torch
from torch.optim.lr_scheduler import ExponentialLR

t1 = torch.tensor([0.0])
opt = torch.optim.SGD([t1], lr=1.0)

torch_lr_scheduler = ExponentialLR(optimizer=opt, gamma=0.98)
lr_values = [None] * 100
scheduler = create_lr_scheduler_with_warmup(torch_lr_scheduler,
                                            warmup_start_value=0.0,
                                            warmup_end_value=None,  # warmup_end_value -> 1.0
                                            warmup_duration=10,
                                            output_simulated_values=lr_values)

print(lr_values)
ykumards added a commit to ykumards/ignite that referenced this issue Mar 29, 2020
@ykumards ykumards mentioned this issue Mar 29, 2020
3 tasks
vfdev-5 added a commit that referenced this issue Mar 29, 2020
* fixes issue #855; when warmup_end_value is None, it is set to the optimizer initial lr

* fix doc string

* Update test_param_scheduler.py

* black formatting

* black formatting

Co-authored-by: vfdev <vfdev.5@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant