(self)
| 48 | super(MultiStepLR, self).__init__(optimizer, last_epoch, verbose) |
| 49 | |
| 50 | def get_lr(self): |
| 51 | if not self._get_lr_called_within_step: |
| 52 | warnings.warn("To get the last learning rate computed by the scheduler, " |
| 53 | "please use `get_last_lr()`.", UserWarning) |
| 54 | |
| 55 | if self.last_epoch not in self.milestones: |
| 56 | return [group['lr'] for group in self.optimizer.param_groups] |
| 57 | return [group['lr'] * self.gamma ** self.milestones[self.last_epoch] |
| 58 | for group in self.optimizer.param_groups] |
| 59 | |
| 60 | def _get_closed_form_lr(self): |
| 61 | milestones = list(sorted(self.milestones.elements())) |
nothing calls this directly
no outgoing calls
no test coverage detected