(self, run_dir, ckpt_every)
| 70 | None, so the training script still runs standalone.""" |
| 71 | |
| 72 | def __init__(self, run_dir, ckpt_every): |
| 73 | self.dir = run_dir |
| 74 | self.ckpt_dir = os.path.join(run_dir, "ckpt") if run_dir else None |
| 75 | self.ckpt_every = ckpt_every |
| 76 | if self.ckpt_dir: |
| 77 | os.makedirs(self.ckpt_dir, exist_ok=True) |
| 78 | self.f = open(os.path.join(run_dir, "metrics.jsonl"), "a", buffering=1) if run_dir else None |
| 79 | self.t0, self.last_frames = time.time(), 0 |
| 80 | self.ckpt_last, self.ms_last, self.best = 0, 0, float("-inf") |
| 81 | |
| 82 | def log(self, frames, scalars): |
| 83 | """Append one structured row (frames + sps + caller's scalars) to metrics.jsonl.""" |
nothing calls this directly
no outgoing calls
no test coverage detected