docstr: Create Prioritized Replay buffer.
  
  See Also ReplayBuffer.__init__
  
  :param size: (int) Max number of transitions to store in the buffer. When the buffer overflows the old memories
      are dropped.
  :param alpha: (float) how much prioritization is used (0 - no prioritization, 1 - full prioritization)
docstr_tok: ["Create","Prioritized","Replay","buffer",".","See","Also","ReplayBuffer.__init__",":","param","size",":","(","int",")","Max","number","of","transitions","to","store","in","the","buffer",".","When","the","buffer","overflows","the","old","memories","are","dropped",".",":","param","alpha",":","(","float",")","how","much","prioritization","is","used","(","0","-","no","prioritization",",","1","-","full","prioritization",")"]
code: def __init__(self, size, alpha):
      """
      Create Prioritized Replay buffer.
  
      See Also ReplayBuffer.__init__
  
      :param size: (int) Max number of transitions to store in the buffer. When the buffer overflows the old memories
          are dropped.
      :param alpha: (float) how much prioritization is used (0 - no prioritization, 1 - full prioritization)
      """
      super(PrioritizedReplayBuffer, self).__init__(size)
      assert alpha >= 0
      self._alpha = alpha
  
      it_capacity = 1
      while it_capacity < size:
          it_capacity *= 2
  
      self._it_sum = SumSegmentTree(it_capacity)
      self._it_min = MinSegmentTree(it_capacity)
      self._max_priority = 1.0
  
imports: import random
  from typing import Optional, List, Union
  import numpy
  from stable_baselines.common.segment_tree import SumSegmentTree, MinSegmentTree
  from stable_baselines.common.vec_env import VecNormalize
label_desc: Use image node_id 1 to create a new PrioritizedReplayBuffer object from inherited base classes: ReplayBuffer with example: obj = PrioritizedReplayBuffer(size, alpha)