(self, threshold=5e-4, patience_epochs=5, mode='min', threshold_mode='rel')
| 304 | class IndicatePlateau(object): |
| 305 | |
| 306 | def __init__(self, threshold=5e-4, patience_epochs=5, mode='min', threshold_mode='rel'): |
| 307 | |
| 308 | self.patience = patience_epochs |
| 309 | self.cooldown_counter = 0 |
| 310 | self.mode = mode |
| 311 | self.threshold = threshold |
| 312 | self.threshold_mode = threshold_mode |
| 313 | self.best = None |
| 314 | self.num_bad_epochs = None |
| 315 | self.mode_worse = None # the worse value for the chosen mode |
| 316 | self.last_epoch = 0 |
| 317 | self._init_is_better(mode=mode, threshold=threshold, |
| 318 | threshold_mode=threshold_mode) |
| 319 | |
| 320 | self._init_is_better(mode=mode, threshold=threshold, |
| 321 | threshold_mode=threshold_mode) |
| 322 | self._reset() |
| 323 | |
| 324 | def _reset(self): |
| 325 | """Resets num_bad_epochs counter and cooldown counter.""" |
nothing calls this directly
no test coverage detected