class_docstr: The A2C algorithm.
  
  Trains policy and value models using the A2C algortithm.
class_docstr_tok: ["The","A2C","algorithm",".","Trains","policy","and","value","models","using","the","A2C","algortithm","."]
docstr: Configures the A2C Trainer.
docstr_tok: ["Configures","the","A2C","Trainer","."]
code: def __init__(
      self, task, value_loss_coeff=0.1, entropy_coeff=0.01, **kwargs
  ):
      """Configures the A2C Trainer."""
      self._value_loss_coeff = value_loss_coeff
      self._entropy_coeff = entropy_coeff
      super().__init__(task, **kwargs)
      self._trainer = supervised.Trainer(
          model=self._joint_model,
          optimizer=self._optimizer,
          lr_schedule=self._lr_schedule,
          loss_fn=self.joint_loss,
          inputs=self._inputs,
          output_dir=self._output_dir,
          metrics={
              "joint_loss": self.joint_loss,
              "advantage_mean": self.advantage_mean,
              "advantage_norm": self.advantage_norm,
              "value_loss": self.value_loss,
              "explained_variance": self.explained_variance,
              "log_probs_mean": self.log_probs_mean,
              "entropy_loss": self.entropy_loss,
              "a2c_objective_mean": self.a2c_objective_mean,
              "approximate_kl_divergence": self.approximate_kl_divergence,
              "preferred_move": self.preferred_move,
          },
      )
  
imports: import functools
  from trax import data
  from trax import layers
  from trax import supervised
  from trax.fastmath import numpy
  from trax.fastmath import stop_gradient
  from trax.rl import actor_critic
  from trax.rl import distributions
  from trax.rl import rl_layers
  from trax.rl import training
  from trax.supervised import lr_schedules
label_desc: Use image node_id 1 to create a new A2CJoint object from inherited base classes: ActorCriticJointAgent with example: obj = A2CJoint(task, value_loss_coeff, entropy_coeff)