MCPcopy Create free account
hub / github.com/rlcode/reinforcement-learning / __init__

Method __init__

4-atari-hard/env.py:72–80  ·  view source on GitHub ↗
(self, run_dir, ckpt_every)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected