DreamerV3UpdateRatio#
- class torchrl.trainers.algorithms.DreamerV3UpdateRatio(ratio: float)[source]#
Schedule learner updates from a ratio of updates to driver records.
Each call truncates the count from the cumulative driver-record count and keeps the remainder. The first call returns one update.
- Parameters:
ratio (float) – Learner updates for each driver record. Non-positive values disable updates.
Examples
>>> from torchrl.trainers.algorithms import DreamerV3UpdateRatio >>> schedule = DreamerV3UpdateRatio(0.25) >>> schedule(4), schedule(6) (1, 0) >>> saved = schedule.state_dict() >>> expected = schedule(8) >>> schedule.load_state_dict(saved) >>> schedule(8) == expected True
See also
- load_state_dict(state_dict: Mapping[str, float | None]) None[source]#
Restore the update schedule’s progress and ratio.