docstr: A2C algorithm
  
  Args:
      model (parl.Model): forward network of policy and value
      vf_loss_coeff (float): coefficient of the value function loss
docstr_tok: ["A2C","algorithm","Args",":","model","(","parl.Model",")",":","forward","network","of","policy","and","value","vf_loss_coeff","(","float",")",":","coefficient","of","the","value","function","loss"]
code: def __init__(self, model, vf_loss_coeff=None):
      """A2C algorithm
  
      Args:
          model (parl.Model): forward network of policy and value
          vf_loss_coeff (float): coefficient of the value function loss
      """
      # check model and vf_loss_coeff input
      check_model_method(model, "value", self.__class__.__name__)
      check_model_method(model, "policy", self.__class__.__name__)
      check_model_method(
          model, "policy_and_value", self.__class__.__name__
      )
      assert isinstance(vf_loss_coeff, (int, float))
  
      self.model = model
      self.vf_loss_coeff = vf_loss_coeff
      clip = paddle.nn.ClipGradByGlobalNorm(clip_norm=40.0)
      self.optimizer = paddle.optimizer.Adam(
          learning_rate=0.001,
          parameters=self.model.parameters(),
          grad_clip=clip,
      )
  
file_path: PARL/parl/algorithms/paddle/a2c.py
imports: import parl
  import paddle
  import paddle.nn.functional
  from paddle.distribution import Categorical
  from parl.utils.utils import check_model_method
  import numpy
label_desc: Use image node_id 1 to create a new A2C object from inherited base classes: parl with example: obj = A2C(model, vf_loss_coeff)