code: def __init__(self, size, alpha=0.6):
      self.size = int(2 ** ceil(log(size, 2)))
      self.memory = np.zeros(self.size, dtype=object)
      self.sum_tree = SumTree(self.size)
      self.min_tree = ReduceTree(self.size, min)
      self.idx = 0
      self.max_value = 1.0
      self.max_value_upper = 1000.0
      self.alpha = alpha
  
file_path: dynet/examples/reinforcement-learning/memory.py
imports: import numpy
  from math import log, ceil
  from reduce_tree import ReduceTree, SumTree
label_desc: Use image node_id 1 to create a new PrioritizedMemory object from inherited base classes: object with example: obj = PrioritizedMemory(size, alpha)