1、调整学习率
torch.optim.lr_scheduler.ReduceLROnPlateau allows dynamic learning rate reducing based on some validation measurements.
2、主要参数
- mode(str)——有两种模式min和max,min表示指标不再降低,max表示指标停止增加
- factor(float)——学习率降低的因素,new_lr = lr * factor,默认值为0.1
- patient(int)——有多少个epochs没有变化,学习率将会降低
参考:https://pytorch.org/docs/stable/optim.html