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: Sample minibatch of size batch_size.
docstr_tok: ["Sample","minibatch","of","size","batch_size","."]
code: def sample_minibatch(self, batch_size):
      """Sample minibatch of size batch_size."""
      pool_size = self.size()
      if pool_size == 0:
          return []
  
      if not self._use_prioritized_replay:
          chosen_idx = (
              range(pool_size)
              if pool_size <= batch_size
              else random.sample(range(pool_size), batch_size)
          )
      else:
          delta_p = self._memory[0] / batch_size
          chosen_idx = []
          for i in range(batch_size):
              lower = max(i * delta_p, 0)
              upper = min((i + 1) * delta_p, self._memory[0])
              p = random.uniform(lower, upper)
              chosen_idx.append(self._sample_with_priority(p))
  
      return [(i, self._memory[i]) for i in chosen_idx]
  
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 9 for calling the ReplayMemory obj's underlying member method code with example usage: obj.sample_minibatch(batch_size) and returns: unknown, list