Exemple #1
0
    def begin_episode(self, agent_indices):
        """Reset the recurrent states and stored episode.

        Args:
          agent_indices: Tensor containing current batch indices.

        Returns:
          Summary tensor.
        """
        with tf.name_scope('begin_episode/'):
            if self._last_state is None:
                reset_state = tf.no_op()
            else:
                reset_state = utility.reinit_nested_vars(
                    self._last_state, agent_indices)
            reset_buffer = self._current_episodes.clear(agent_indices)
            with tf.control_dependencies([reset_state, reset_buffer]):
                return tf.constant('')
Exemple #2
0
  def begin_episode(self, agent_indices):
    """Reset the recurrent states and stored episode.

    Args:
      agent_indices: Tensor containing current batch indices.

    Returns:
      Summary tensor.
    """
    with tf.name_scope('begin_episode/'):
      if self._last_state is None:
        reset_state = tf.no_op()
      else:
        reset_state = utility.reinit_nested_vars(
            self._last_state, agent_indices)
      reset_buffer = self._current_episodes.clear(agent_indices)
      with tf.control_dependencies([reset_state, reset_buffer]):
        return tf.constant('')