(self, current_step, lr_init)
| 152 | return lr_scheduler.LambdaLR(optimizer, lr_lambda, self.last_epoch) |
| 153 | |
| 154 | def lambda_func(self, current_step, lr_init): |
| 155 | if current_step < self.warmup_epoch: |
| 156 | return float(current_step) / float(max(1, self.warmup_epoch)) |
| 157 | elif current_step > self.epochs: |
| 158 | return self.lr_end / lr_init # as LambdaLR multiplies by lr_init |
| 159 | else: |
| 160 | lr_range = lr_init - self.lr_end |
| 161 | decay_steps = self.epochs - self.warmup_epoch |
| 162 | pct_remaining = 1 - (current_step - self.warmup_epoch) / decay_steps |
| 163 | decay = lr_range * pct_remaining ** self.power + self.lr_end |
| 164 | return decay / lr_init # as LambdaLR multiplies by lr_init |
| 165 | |
| 166 | |
| 167 | def get_no_weight_decay_param(model, config): |
nothing calls this directly
no outgoing calls
no test coverage detected