コード例 #1
0
    def on_batch_start(self, runner: IRunner) -> None:
        """Batch start hook.

        Args:
            runner: current runner
        """
        runner.batch_metrics = defaultdict(None)
コード例 #2
0
 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)