MCPcopy Index your code
hub / github.com/rlcode/reinforcement-learning / log

Method log

4-atari-hard/env.py:82–89  ·  view source on GitHub ↗

Append one structured row (frames + sps + caller's scalars) to metrics.jsonl.

(self, frames, scalars)

Source from the content-addressed store, hash-verified

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."""
84 if not self.f:
85 return
86 now = time.time()
87 sps = (frames - self.last_frames) / max(now - self.t0, 1e-9)
88 self.f.write(json.dumps({"ts": round(now, 1), "frames": frames, "sps": round(sps, 1), **scalars}) + "\n")
89 self.t0, self.last_frames = now, frames
90
91 def resolve_resume(self, resume_arg):
92 """'auto' -> run_dir/ckpt/latest.pt, else a path, else None."""

Callers 5

mainFunction · 0.95
2-ppo.pyFile · 0.45
1-dqn.pyFile · 0.45
1-ppo-rnd.pyFile · 0.45
2-go-explore.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected