CountFramesLog¶
- class torchrl.trainers.CountFramesLog(*args, **kwargs)[源代码]¶
一个帧计数器钩子。
- 参数:
frame_skip (int) – 环境的帧跳过。此参数对于跟踪总帧数(而不是可见帧数)非常重要。
log_pbar (bool, optional) – 如果为
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')[源代码]¶
Registers the hook in the trainer at a default location.
- 参数:
trainer (Trainer) – the trainer where the hook must be registered.
name (str) – the name of the hook.
注意
To register the hook at another location than the default, use
register_op()
.