class_docstr: An out-of-graph Replay Buffer for Prioritized Experience Replay.
  See circular_replay_buffer.py for details.
docstr: Initializes PrioritizedReplayBuffer.
  Args:
    stack_size: int, number of frames to use in state stack.
    replay_capacity: int, number of transitions to keep in memory.
    batch_size: int.
    update_horizon: int, length of update ('n' in n-step update).
    gamma: int, the discount factor.
code: def __init__(
      self,
      stack_size: int,
      replay_capacity: int,
      batch_size: int,
      update_horizon: int = 1,
      gamma: float = 0.99,
      max_sample_attempts: int = 1000,
  ) -> None:
      """Initializes PrioritizedReplayBuffer.
      Args:
        stack_size: int, number of frames to use in state stack.
        replay_capacity: int, number of transitions to keep in memory.
        batch_size: int.
        update_horizon: int, length of update ('n' in n-step update).
        gamma: int, the discount factor.
      """
      super(PrioritizedReplayBuffer, self).__init__(
          stack_size=stack_size,
          replay_capacity=replay_capacity,
          batch_size=batch_size,
          update_horizon=update_horizon,
          gamma=gamma,
      )
      self._max_sample_attempts = max_sample_attempts
      self.sum_tree = sum_tree.SumTree(replay_capacity)
  
file_path: ReAgent/reagent/replay_memory/prioritized_replay_buffer.py
imports: import numpy
  import torch
  from reagent.replay_memory import circular_replay_buffer, sum_tree
label_desc: Use image node_id 1 to create a new PrioritizedReplayBuffer object from inherited base classes: circular_replay_buffer with example: obj = PrioritizedReplayBuffer(stack_size, replay_capacity, batch_size, update_horizon, gamma, max_sample_attempts)