MCPcopy Create free account
hub / github.com/PaddlePaddle/Research / __init__

Method __init__

CV/SemSegPaddle/src/utils/solver.py:25–38  ·  view source on GitHub ↗
(self, main_prog, start_prog)

Source from the content-addressed store, hash-verified

23
24class Solver(object):
25 def __init__(self, main_prog, start_prog):
26 total_images = cfg.DATASET.TRAIN_TOTAL_IMAGES
27 self.weight_decay = cfg.SOLVER.WEIGHT_DECAY
28 self.momentum = cfg.SOLVER.MOMENTUM
29 self.momentum2 = cfg.SOLVER.MOMENTUM2
30 self.step_per_epoch = total_images // cfg.TRAIN_BATCH_SIZE
31 if total_images % cfg.TRAIN_BATCH_SIZE != 0:
32 self.step_per_epoch += 1
33 self.total_step = cfg.SOLVER.NUM_EPOCHS * self.step_per_epoch
34 self.main_prog = main_prog
35 self.start_prog = start_prog
36 self.warmup_step = cfg.SOLVER.LR_WARMUP_STEPS if cfg.SOLVER.LR_WARMUP else -1
37 self.decay_step = self.total_step - self.warmup_step
38 self.decay_epochs = cfg.SOLVER.NUM_EPOCHS - self.warmup_step / self.step_per_epoch
39
40 def lr_warmup(self, learning_rate, start_lr, end_lr):
41 linear_step = end_lr - start_lr

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected