class_docstr: Replay memory to store samples of experience.
  
  Each transition is represented as (state, action, reward, next_state,
  priority) tuple. 'priority' is ignored for non-prioritized experience
  replay.
class_docstr_tok: ["Replay","memory","to","store","samples","of","experience",".","Each","transition","is","represented","as","(","state",",","action",",","reward",",","next_state",",","priority",")","tuple",".","'priority","'","is","ignored","for","non-prioritized","experience","replay","."]
docstr: Create replay memory with size capacity.
docstr_tok: ["Create","replay","memory","with","size","capacity","."]
code: def __init__(self, capacity, prioritized=False):
      """Create replay memory with size capacity."""
      self._use_prioritized_replay = prioritized
      self._capacity = capacity
      # Position in the list where new experience will be written to.
      self._position = 0
      # For prioritized replay, 'sum-tree' data structure is used.
      # Transitions are stored in leaf nodes, while internal nodes store the
      # sum of priorities from all its descendants. List is used to represent
      # this complete binary tree. The following code initializes
      # all internal nodes, if any, to have value 0.
      self._memory = [0] * (capacity - 1) if prioritized else []
  
file_path: CNTK/bindings/python/cntk/contrib/deeprl/agent/shared/replay_memory.py
imports: from __future__ import division
  import math
  import random
  from collections import namedtuple
label_desc: Use image node_id 1 to create a new ReplayMemory object  with example: obj = ReplayMemory(capacity, prioritized)