MCPcopy Create free account
hub / github.com/albertpumarola/GANimation / lambda_rule

Method lambda_rule

models/models.py:122–124  ·  view source on GitHub ↗
(epoch)

Source from the content-addressed store, hash-verified

120 def _get_scheduler(self, optimizer, opt):
121 if opt.lr_policy == 'lambda':
122 def lambda_rule(epoch):
123 lr_l = 1.0 - max(0, epoch + 1 + opt.epoch_count - opt.niter) / float(opt.niter_decay + 1)
124 return lr_l
125 scheduler = lr_scheduler.LambdaLR(optimizer, lr_lambda=lambda_rule)
126 elif opt.lr_policy == 'step':
127 scheduler = lr_scheduler.StepLR(optimizer, step_size=opt.lr_decay_iters, gamma=0.1)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected