(self, epoch, batch_id, total_batches, optimizer)
| 79 | param_group['lr'] = lr |
| 80 | |
| 81 | def warmup_learning_rate(self, epoch, batch_id, total_batches, optimizer): |
| 82 | args = self.args |
| 83 | if args.warm and epoch <= args.warm_epochs: |
| 84 | p = (batch_id + (epoch - 1) * total_batches) / \ |
| 85 | (args.warm_epochs * total_batches) |
| 86 | lr = args.warmup_from + p * (args.warmup_to - args.warmup_from) |
| 87 | |
| 88 | for param_group in optimizer.param_groups: |
| 89 | param_group['lr'] = lr |
no outgoing calls
no test coverage detected