Closed yongduek closed 4 years ago
Great catch and thanks for spotting!
The LR finder code was a modified version of https://github.com/davidtvs/pytorch-lr-finder/. It looks like they also use get_lr
and add the lr
to their history after the step too, see here.
Might be worth raising an issue on there as well?
I was looking for a pytorch lrfinder and came to see your tutorials. Very nice and thank you for sharing them.
When
lrs
from LRFinder was printed out (AlexNet.ipynb), it did not start with 1e-7. So two things seem to be modified to make it happen.Order change:
get_lr()
before append tolrs
Function change: 'get_last_lr()` to get the latest lr. This seems to be a change in pytorch.
self.last_epoch
does not need to be incremented.super().__init__()
callsstep()
within _LRScheduler, thenstep()
callsget_lr()
to update the values. The results are saved in variables in the base class (_LRScheduler
), and the lastly updated learning rate (or list of lrs) are retrieved byget_last_lr()
. This seems to be the recent pytorch way of using it.