def sample(self, batch_size):
    if self.do_valid:
        batch_idxs = np.random.randint(self.nb_valid_items, (self.nb_entries - 1), size=batch_size)
    else:
        batch_idxs = np.random.randint((self.nb_entries - 1), size=batch_size)
    obs0_batch = self.observations0.get_batch(batch_idxs)
    action_batch = self.actions.get_batch(batch_idxs)
    flag_teacher = (batch_idxs < self.nb_teach).astype(np.float32)
    result = {'obs0': array_min2d(obs0_batch), 'actions': array_min2d(action_batch), 'flag_teacher': array_min2d(flag_teacher)}
    return result
def sample(self, batch_size):
    if self.do_valid:
        batch_idxs = np.random.randint(self.nb_valid_items, (self.nb_entries - 1), size=batch_size)
    else:
        batch_idxs = np.random.randint((self.nb_entries - 1), size=batch_size)
    obs0_batch = self.observations0.get_batch(batch_idxs)
    action_batch = self.actions.get_batch(batch_idxs)
    flag_teacher = (batch_idxs < self.nb_teach).astype(np.float32)
    result = {'obs0': array_min2d(obs0_batch), 'actions': array_min2d(action_batch), 'flag_teacher': array_min2d(flag_teacher)}
    return result