Mighty prioritized replay
mighty.mighty_replay.mighty_prioritized_replay
#
PrioritizedReplay
#
PrioritizedReplay(
capacity,
alpha=1.0,
beta=1.0,
epsilon=1e-06,
device="cpu",
keep_infos=False,
flatten_infos=False,
obs_shape: Tuple[int, ...] | list[int] = None,
action_shape: Tuple[int, ...] | list[int] = None,
)
Bases: MightyReplay
Much faster Prioritized Replay using a sum-tree + on-device storage.
Source code in mighty/mighty_replay/mighty_prioritized_replay.py
add
#
add(
transition_batch: TransitionBatch, metrics: dict
) -> None
Add a single transition with the computed td_error.
Source code in mighty/mighty_replay/mighty_prioritized_replay.py
reset
#
sample
#
Sample a batch of transitions and return importance weights + indices.
Source code in mighty/mighty_replay/mighty_prioritized_replay.py
save
#
update_priorities
#
After learning, update the priorities for the sampled indices.