class_docstr: Actor-critic agent for episodic setting.
  
  An actor-critic algorithm consists of several components:
  
      - **Actor** is the policy to optimize. As a temporary implementation,        here by default we use a :class:`~texar.tf.agents.PGAgent` instance         that wraps a `policy net` and provides proper interfaces to perform         the role of an actor.
      - **Critic** that provides learning signals to the actor. Again, as         a temporary implemetation, here by default we use a         :class:`~texar.tf.agents.DQNAgent` instance that wraps a `Q net` and         provides proper interfaces to perform the role of a critic.
  
  Args:
      env_config: An instance of :class:`~texar.tf.agents.EnvConfig`
          specifying action space, observation space, and reward range, etc.
          Use :func:`~texar.tf.agents.get_gym_env_config` to create an
          EnvConfig from a gym environment.
      sess (optional): A tf session.
          Can be `None` here and set later with `agent.sess = session`.
      actor (optional): An instance of :class:`~texar.tf.agents.PGAgent` that
          performs as actor in the algorithm.
          If not provided, an actor is created based on :attr:`hparams`.
      actor_kwargs (dict, optional): Keyword arguments for actor
          constructor. Note that the `hparams` argument for actor
          constructor is specified in the "actor_hparams" field of
          :attr:`hparams` and should not be included in `actor_kwargs`.
          Ignored if :attr:`actor` is given.
      critic (optional): An instance of :class:`~texar.tf.agents.DQNAgent`
          that performs as critic in the algorithm.
          If not provided, a critic is created based on :attr:`hparams`.
      critic_kwargs (dict, optional): Keyword arguments for critic
          constructor. Note that the `hparams` argument for critic
          constructor is specified in the "critic_hparams" field of
          :attr:`hparams` and should not be included in `critic_kwargs`.
          Ignored if :attr:`critic` is given.
      hparams (dict or HParams, optional): Hyperparameters. Missing
          hyperparamerters will be set to default values. See
          :meth:`default_hparams` for the hyperparameter sturcture and
          default values.
class_docstr_tok: ["Actor-critic","agent","for","episodic","setting",".","An","actor-critic","algorithm","consists","of","several","components",":","-","*","*","Actor","*","*","is","the","policy","to","optimize",".","As","a","temporary","implementation",",","here","by","default","we","use","a",":","class",":","`","~texar.tf.agents.PGAgent","`","instance","that","wraps","a","`","policy","net","`","and","provides","proper","interfaces","to","perform","the","role","of","an","actor",".","-","*","*","Critic","*","*","that","provides","learning","signals","to","the","actor",".","Again",",","as","a","temporary","implemetation",",","here","by","default","we","use","a",":","class",":","`","~texar.tf.agents.DQNAgent","`","instance","that","wraps","a","`","Q","net","`","and","provides","proper","interfaces","to","perform","the","role","of","a","critic",".","Args",":","env_config",":","An","instance","of",":","class",":","`","~texar.tf.agents.EnvConfig","`","specifying","action","space",",","observation","space",",","and","reward","range",",","etc",".","Use",":","func",":","`","~texar.tf.agents.get_gym_env_config","`","to","create","an","EnvConfig","from","a","gym","environment",".","sess","(","optional",")",":","A","tf","session",".","Can","be","`","None","`","here","and","set","later","with","`","agent.sess","=","session","`",".","actor","(","optional",")",":","An","instance","of",":","class",":","`","~texar.tf.agents.PGAgent","`","that","performs","as","actor","in","the","algorithm",".","If","not","provided",",","an","actor","is","created","based","on",":","attr",":","`","hparams","`",".","actor_kwargs","(","dict",",","optional",")",":","Keyword","arguments","for","actor","constructor",".","Note","that","the","`","hparams","`","argument","for","actor","constructor","is","specified","in","the","``","actor_hparams","''","field","of",":","attr",":","`","hparams","`","and","should","not","be","included","in","`","actor_kwargs","`",".","Ignored","if",":","attr",":","`","actor","`","is","given",".","critic","(","optional",")",":","An","instance","of",":","class",":","`","~texar.tf.agents.DQNAgent","`","that","performs","as","critic","in","the","algorithm",".","If","not","provided",",","a","critic","is","created","based","on",":","attr",":","`","hparams","`",".","critic_kwargs","(","dict",",","optional",")",":","Keyword","arguments","for","critic","constructor",".","Note","that","the","`","hparams","`","argument","for","critic","constructor","is","specified","in","the","``","critic_hparams","''","field","of",":","attr",":","`","hparams","`","and","should","not","be","included","in","`","critic_kwargs","`",".","Ignored","if",":","attr",":","`","critic","`","is","given",".","hparams","(","dict","or","HParams",",","optional",")",":","Hyperparameters",".","Missing","hyperparamerters","will","be","set","to","default","values",".","See",":","meth",":","`","default_hparams","`","for","the","hyperparameter","sturcture","and","default","values","."]
docstr: The tf session.
          
docstr_tok: ["The","tf","session","."]
code: def sess(self):
      """The tf session."""
      return self._sess
  
file_path: texar/texar/tf/agents/ac_agent.py
imports: import tensorflow
  import numpy
  from texar.tf.agents.episodic_agent_base import EpisodicAgentBase
  from texar.tf.utils import utils
label_desc: Use image node_id 7 for calling the ActorCriticAgent obj's underlying member method code with example usage: obj.sess() and returns: self