def on_batch_start(self, runner: IRunner) -> None: """Batch start hook. Args: runner: current runner """ runner.batch_metrics = defaultdict(None)
def on_batch_end(self, runner: IRunner) -> None: """Batch end hook. Args: runner (IRunner): current runner """ runner.batch_metrics = self._process_metrics(runner.batch_metrics) for key, value in runner.batch_metrics.items(): self.meters[key].add(value, runner.batch_size)