correct_for_frame_skip¶
- torchrl.trainers.helpers.correct_for_frame_skip(cfg: DictConfig) DictConfig [源]¶
根据输入的 frame_skip 调整参数,将所有反映帧计数的参数除以 frame_skip。
此函数旨在避免在不知情的情况下从环境中过度采样,例如,目标总帧数为 1M,但实际收集了 frame_skip * 1M 帧。
- 参数:
cfg (DictConfig) – 包含一些帧计数参数的 DictConfig,包括:“max_frames_per_traj”, “total_frames”, “frames_per_batch”, “record_frames”, “annealing_frames”, “init_random_frames”, “init_env_steps”
- 返回:
输入的 DictConfig,已原地修改。