(self, step: int, metrics: dict[str, Any])
| 44 | print(f"[logger] stage={stage} -> {self.path}") |
| 45 | |
| 46 | def log(self, step: int, metrics: dict[str, Any]) -> None: |
| 47 | record = {"step": step, "wall": time.time(), **metrics} |
| 48 | self._fh.write(json.dumps(record) + "\n") |
| 49 | self._fh.flush() |
| 50 | if self._wandb is not None: |
| 51 | self._wandb.log(metrics, step=step) |
| 52 | |
| 53 | def close(self) -> None: |
| 54 | try: |