optimizerG = optim.Adam(netG.parameters(), lr=opt.lr_g, betas=(opt.beta1, 0.999))
torch.optim.lr_scheduler.MultiStepLR(optimizer=optimizerG,milestones=[1600],gamma=opt.gamma)

torch.optim.lr_scheduler.MultiStepLR(optimizer, milestones, gamma=0.1, last_epoch=-1)
milestones为一个数组,如 [50,70]. gamma为倍数。如果learning rate开始为0.01 ,则当epoch为50时变为0.001,epoch 为70 时变为0.0001。
当last_epoch=-1,设定为初始lr。

参考博客:

https://blog.csdn.net/qq_41872630/article/details/86749972

相关文章:

  • 2021-12-18
  • 2021-09-01
  • 2022-12-23
  • 2021-09-08
  • 2021-07-15
  • 2021-10-16
猜你喜欢
  • 2021-07-27
  • 2021-05-16
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
  • 2021-09-02
相关资源
相似解决方案