How to change the learning rate of an optimizer at any given moment (no LR schedule)?
So the learning rate is stored in optim.param_groups[i][‘lr’]. optim.param_groups is a list of the different weight groups which can have different learning rates. Thus, simply doing: for g in optim.param_groups: g[‘lr’] = 0.001 will do the trick. **Alternatively**, as mentionned in the comments, if your learning rate only depends on the epoch number, you can … Read more