MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / lambda_rule

Function lambda_rule

pix2pix/models/networks.py:52–54  ·  view source on GitHub ↗
(epoch)

Source from the content-addressed store, hash-verified

50 """
51 if opt.lr_policy == 'linear':
52 def lambda_rule(epoch):
53 lr_l = 1.0 - max(0, epoch + opt.epoch_count - opt.n_epochs) / float(opt.n_epochs_decay + 1)
54 return lr_l
55 scheduler = lr_scheduler.LambdaLR(optimizer, lr_lambda=lambda_rule)
56 elif opt.lr_policy == 'step':
57 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