def __init__(self, env, handle, name, learning_rate=1e-3,
                 batch_size=64, reward_decay=0.99, eval_obs=None,
                 train_freq=1, value_coef=0.1, ent_coef=0.08, use_comm=False,
                 custom_view_space=None, custom_feature_space=None):
        """init a model

        Parameters
        ----------
        env: Environment
            environment
        handle: Handle (ctypes.c_int32)
            handle of this group, can be got by env.get_handles
        name: str
            name of this model
        learning_rate: float
        batch_size: int
        reward_decay: float
            reward_decay in TD
        eval_obs: numpy array
            evaluation set of observation
        train_freq: int
            mean training times of a sample
        ent_coef: float
            weight of entropy loss in total loss
        value_coef: float
            weight of value loss in total loss
        use_comm: bool
            whether use CommNet
        custom_feature_space: tuple
            customized feature space
        custom_view_space: tuple
            customized feature space
        """
        TFBaseModel.__init__(self, env, handle, name, "tfa2c")
        # ======================== set config  ========================
        self.env = env
        self.handle = handle
        self.name = name
        self.view_space = custom_view_space or env.get_view_space(handle)
        self.feature_space = custom_feature_space or env.get_feature_space(handle)
        self.num_actions  = env.get_action_space(handle)[0]
        self.reward_decay = reward_decay

        self.batch_size   = batch_size
        self.learning_rate= learning_rate
        self.train_freq   = train_freq   # train time of every sample (s,a,r,s')

        self.value_coef = value_coef     # coefficient of value in the total loss
        self.ent_coef = ent_coef         # coefficient of entropy in the total loss

        self.train_ct = 0
        self.use_comm = use_comm

        # ======================= build network =======================
        with tf.name_scope(self.name):
            self._create_network(self.view_space, self.feature_space)

        # init tensorflow session
        config = tf.ConfigProto(allow_soft_placement=True, log_device_placement=False)
        config.gpu_options.allow_growth = True
        self.sess = tf.Session(config=config)
        self.sess.run(tf.global_variables_initializer())

        # init training buffers
        self.view_buf = np.empty((1,) + self.view_space)
        self.feature_buf = np.empty((1,) + self.feature_space)
        self.action_buf = np.empty(1, dtype=np.int32)
        self.reward_buf = np.empty(1, dtype=np.float32)
init a model

        Parameters
        ----------
        env: Environment
            environment
        handle: Handle (ctypes.c_int32)
            handle of this group, can be got by env.get_handles
        name: str
            name of this model
        learning_rate: float
        batch_size: int
        reward_decay: float
            reward_decay in TD
        eval_obs: numpy array
            evaluation set of observation
        train_freq: int
            mean training times of a sample
        ent_coef: float
            weight of entropy loss in total loss
        value_coef: float
            weight of value loss in total loss
        use_comm: bool
            whether use CommNet
        custom_feature_space: tuple
            customized feature space
        custom_view_space: tuple
            customized feature space
        
python/magent/builtin/tf_model/a2c.py