(self)
| 106 | super().__init__(optimizer, last_epoch) |
| 107 | |
| 108 | def get_lr(self): |
| 109 | if self.last_epoch == 0 or self.last_epoch > self.total_iters: |
| 110 | return [group['lr'] for group in self.optimizer.param_groups] |
| 111 | |
| 112 | decay_factor = ((1.0 - self.last_epoch / self.total_iters) / (1.0 - (self.last_epoch - 1) / self.total_iters)) ** self.power |
| 113 | return [group['lr'] * decay_factor for group in self.optimizer.param_groups] |
| 114 | |
| 115 | class LinearWarmupCosineAnnealingLR(_LRScheduler): |
| 116 | def __init__(self, optimizer, warmup_epochs, max_epochs, warmup_start_lr=0.0, eta_min=0.0, last_epoch=-1): |
nothing calls this directly
no outgoing calls
no test coverage detected