(self, frame, epoch_num, total_time)
| 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 | |
| 148 | def _print_env_debug(env, env_cfg, agent_cfg, log_root_path: str, log_dir: str) -> None: |
nothing calls this directly
no test coverage detected