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().