MCPcopy Create free account
hub / github.com/BrainCoTech/RevoLab / after_print_stats

Method after_print_stats

scripts/rl_games/train.py:122–145  ·  view source on GitHub ↗
(self, frame, epoch_num, total_time)

Source from the content-addressed store, hash-verified

120 return summary
121
122 def after_print_stats(self, frame, epoch_num, total_time):
123 ep_summary = self._summarize_episode_infos()
124 direct_summary: dict[str, float] = {}
125 for key, value in self.direct_info.items():
126 if isinstance(value, torch.Tensor):
127 direct_summary[key] = value.item()
128 else:
129 direct_summary[key] = float(value)
130
131 super().after_print_stats(frame, epoch_num, total_time)
132
133 print("\n" + "*" * 100)
134 print(f"[EPOCH {epoch_num}] frame={frame} total_time={total_time:.2f}s")
135 if ep_summary:
136 print("[EPISODE]")
137 for key in sorted(ep_summary):
138 print(f" {key}: {ep_summary[key]:.6f}")
139 else:
140 print("[EPISODE] no episodic stats collected this epoch")
141 if direct_summary:
142 print("[DIRECT]")
143 for key in sorted(direct_summary):
144 print(f" {key}: {direct_summary[key]:.6f}")
145 print("*" * 100)
146
147
148def _print_env_debug(env, env_cfg, agent_cfg, log_root_path: str, log_dir: str) -> None:

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected