MCPcopy Create free account
hub / github.com/TPCD/DCCL / __init__

Method __init__

project_utils/general_utils.py:306–322  ·  view source on GitHub ↗
(self, threshold=5e-4, patience_epochs=5, mode='min', threshold_mode='rel')

Source from the content-addressed store, hash-verified

304class 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."""

Callers

nothing calls this directly

Calls 2

_init_is_betterMethod · 0.95
_resetMethod · 0.95

Tested by

no test coverage detected