To increment the step counter and update the lr
(self)
| 111 | self.apply(p.name, p, g) |
| 112 | |
| 113 | def step(self): |
| 114 | """To increment the step counter and update the lr""" |
| 115 | self.step_counter.data += 1 |
| 116 | lr_value = self.lr(self.step_counter) |
| 117 | self.lr_value.copy_from(lr_value) |
| 118 | |
| 119 | def apply(self, param_name, param_value, param_grad): |
| 120 | """Performs a single optimization step. |