Tony-Y / pytorch_warmup

Learning Rate Warmup in PyTorch
https://tony-y.github.io/pytorch_warmup/
MIT License
386 stars 25 forks source link

About the learning rate in scheduler #15

Closed Arios42 closed 1 year ago

Arios42 commented 1 year ago

I follow the tutorial to implement the warmup_scheduler, but the learning rate I get from the get_lasr_lr() of the torch.optim.lr_scheduler.MultiStepLR is the same as the initial learning rate. How should I get the learning rate after the warmup process?

Tony-Y commented 1 year ago

The learning rate can be got as the following:

https://github.com/Tony-Y/pytorch_warmup/blob/ed2b7bdfa43cd11b346fd4bfb2f5f7f055531bab/examples/emnist/main.py#L35