Skip to content

Commit

Permalink
Update networks.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Naruto-Sasuke authored Sep 4, 2018
1 parent bcfbb81 commit 65e3da2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions models/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def lambda_rule(epoch):
scheduler = lr_scheduler.StepLR(optimizer, step_size=opt.lr_decay_iters, gamma=0.1)
elif opt.lr_policy == 'plateau':
scheduler = lr_scheduler.ReduceLROnPlateau(optimizer, mode='min', factor=0.2, threshold=0.01, patience=5)
elif opt.lr_policy == 'cosine':
scheduler = lr_scheduler.CosineAnnealingLR(optimizer, T_max=opt.niter, eta_min=0)
else:
return NotImplementedError('learning rate policy [%s] is not implemented', opt.lr_policy)
return scheduler
Expand Down

0 comments on commit 65e3da2

Please sign in to comment.