def construct_feed_dict(self, model, mini_batch, num_sequences):
    feed_dict = {model.batch_size: num_sequences, model.sequence_length: self.sequence_length, model.mask_input: mini_batch['masks'], model.advantage: mini_batch['advantages'], model.all_old_log_probs: mini_batch['action_probs']}
    for name in self.reward_signals:
        feed_dict[model.returns_holders[name]] = mini_batch['{}_returns'.format(name)]
        feed_dict[model.old_values[name]] = mini_batch['{}_value_estimates'.format(name)]
    if self.use_continuous_act:
        feed_dict[model.output_pre] = mini_batch['actions_pre']
        feed_dict[model.epsilon] = mini_batch['random_normal_epsilon']
    else:
        feed_dict[model.action_holder] = mini_batch['actions']
        if self.use_recurrent:
            feed_dict[model.prev_action] = mini_batch['prev_action']
        feed_dict[model.action_masks] = mini_batch['action_mask']
    if self.use_vec_obs:
        feed_dict[model.vector_in] = mini_batch['vector_obs']
    if (self.model.vis_obs_size > 0):
        for (i, _) in enumerate(self.model.visual_in):
            feed_dict[model.visual_in[i]] = mini_batch[('visual_obs%d' % i)]
    if self.use_recurrent:
        mem_in = [mini_batch['memory'][i] for i in range(0, len(mini_batch['memory']), self.sequence_length)]
        feed_dict[model.memory_in] = mem_in
    return feed_dict
def construct_feed_dict(self, model, mini_batch, num_sequences):
    feed_dict = {model.batch_size: num_sequences, model.sequence_length: self.sequence_length, model.mask_input: mini_batch['masks'], model.advantage: mini_batch['advantages'], model.all_old_log_probs: mini_batch['action_probs']}
    for name in self.reward_signals:
        feed_dict[model.returns_holders[name]] = mini_batch['{}_returns'.format(name)]
        feed_dict[model.old_values[name]] = mini_batch['{}_value_estimates'.format(name)]
    if self.use_continuous_act:
        feed_dict[model.output_pre] = mini_batch['actions_pre']
        feed_dict[model.epsilon] = mini_batch['random_normal_epsilon']
    else:
        feed_dict[model.action_holder] = mini_batch['actions']
        if self.use_recurrent:
            feed_dict[model.prev_action] = mini_batch['prev_action']
        feed_dict[model.action_masks] = mini_batch['action_mask']
    if self.use_vec_obs:
        feed_dict[model.vector_in] = mini_batch['vector_obs']
    if (self.model.vis_obs_size > 0):
        for (i, _) in enumerate(self.model.visual_in):
            feed_dict[model.visual_in[i]] = mini_batch[('visual_obs%d' % i)]
    if self.use_recurrent:
        mem_in = [mini_batch['memory'][i] for i in range(0, len(mini_batch['memory']), self.sequence_length)]
        feed_dict[model.memory_in] = mem_in
    return feed_dict