Add argument to disable ReduceLROnPlateau by default
This commit is contained in:
parent
a2e3a9dc64
commit
2aed00d97e
@ -90,6 +90,8 @@ def add_train_args(parser):
|
|||||||
help='initial adversary learning rate')
|
help='initial adversary learning rate')
|
||||||
parser.add_argument('--adv-weight-decay', type=float,
|
parser.add_argument('--adv-weight-decay', type=float,
|
||||||
help='adversary weight decay')
|
help='adversary weight decay')
|
||||||
|
parser.add_argument('--reduce-lr-on-plateau', action='store_true',
|
||||||
|
help='Enable ReduceLROnPlateau learning rate scheduler')
|
||||||
parser.add_argument('--epochs', default=128, type=int,
|
parser.add_argument('--epochs', default=128, type=int,
|
||||||
help='total number of epochs to run')
|
help='total number of epochs to run')
|
||||||
parser.add_argument('--seed', default=42, type=int,
|
parser.add_argument('--seed', default=42, type=int,
|
||||||
|
@ -210,6 +210,7 @@ def gpu_worker(local_rank, args):
|
|||||||
args)
|
args)
|
||||||
epoch_loss = val_loss
|
epoch_loss = val_loss
|
||||||
|
|
||||||
|
if args.reduce_lr_on_plateau:
|
||||||
if epoch >= args.adv_delay:
|
if epoch >= args.adv_delay:
|
||||||
scheduler.step(epoch_loss[0])
|
scheduler.step(epoch_loss[0])
|
||||||
if args.adv:
|
if args.adv:
|
||||||
|
Loading…
Reference in New Issue
Block a user