CountFramesLog¶ class torchrl.trainers.CountFramesLog(*args, **kwargs)[来源]¶ 帧计数器钩子。 参数: frame_skip (int) – 环境的帧跳过。此参数对于跟踪总帧数(而非表观帧数)非常重要。 log_pbar (bool, 可选) – 如果 True,奖励值将记录在进度条上。默认为 False。 示例 >>> count_frames = CountFramesLog(frame_skip=frame_skip) >>> trainer.register_op("pre_steps_log", count_frames) register(trainer: Trainer, name: str = 'count_frames_log')[来源]¶ 在训练器的默认位置注册钩子。 参数: trainer (Trainer) – 必须注册钩子的训练器。 name (str) – 钩子的名称。 注意 要在非默认位置注册钩子,请使用 register_op()。