Gets the current EMA decay rate.
(self)
| 143 | self.__dict__.update(state_dict) |
| 144 | |
| 145 | def get_value(self): |
| 146 | """Gets the current EMA decay rate.""" |
| 147 | epoch = max(0, self.last_epoch - self.start_at) |
| 148 | value = 1 - (1 + epoch / self.inv_gamma) ** -self.power |
| 149 | return 0. if epoch < 0 else min(self.max_value, max(self.min_value, value)) |
| 150 | |
| 151 | def step(self): |
| 152 | """Updates the step count.""" |