def sample(self, n):
    mini_batch = random.sample(self.buffer, n)
    (s_lst, a_lst, r_lst, s_prime_lst, done_mask_lst) = ([], [], [], [], [])
    for transition in mini_batch:
        (s, a, r, s_prime, done_mask) = transition
        s_lst.append(s)
        a_lst.append(a)
        r_lst.append(r)
        s_prime_lst.append(s_prime)
        done_mask_lst.append(done_mask)
    return (np.array(s_lst), np.array(a_lst), np.array(r_lst), np.array(s_prime_lst), np.array(done_mask_lst))
def sample(self, n):
    mini_batch = random.sample(self.buffer, n)
    (s_lst, a_lst, r_lst, s_prime_lst, done_mask_lst) = ([], [], [], [], [])
    for transition in mini_batch:
        (s, a, r, s_prime, done_mask) = transition
        s_lst.append(s)
        a_lst.append(a)
        r_lst.append(r)
        s_prime_lst.append(s_prime)
        done_mask_lst.append(done_mask)
    return (np.array(s_lst), np.array(a_lst), np.array(r_lst), np.array(s_prime_lst), np.array(done_mask_lst))