def __init__(self, trainer, log_gpu_memory: Optional[str] = None): self.trainer = trainer self.log_gpu_memory = log_gpu_memory self._callback_metrics = MetricsHolder() self._evaluation_callback_metrics = MetricsHolder(to_float=True) self._logged_metrics = MetricsHolder() self._progress_bar_metrics = MetricsHolder(to_float=True) self.eval_loop_results = [] self._cached_results = {stage: EpochResultStore(trainer, stage) for stage in RunningStage} self._cached_results[None] = EpochResultStore(trainer, None) self._callback_hook_validator = CallbackHookNameValidator()
def __init__(self, trainer): self.trainer = trainer self.callback_metrics = {} self.evaluation_callback_metrics = {} self.logged_metrics = {} self.progress_bar_metrics = {} self.eval_loop_results = [] self._cached_results = {stage: EpochResultStore(trainer, stage) for stage in LoggerStages} self._callback_hook_validator = CallbackHookNameValidator() self._current_stage = None