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,已原地修改。