def _create_network(self, view_space, feature_space):
        """define computation graph of network

        Parameters
        ----------
        view_space: tuple
        feature_space: tuple
            the input shape
        """
        # input
        input_view    = tf.placeholder(tf.float32, (None,) + view_space)
        input_feature = tf.placeholder(tf.float32, (None,) + feature_space)
        action = tf.placeholder(tf.int32, [None])
        reward = tf.placeholder(tf.float32, [None])
        num_agent = tf.placeholder(tf.int32, [])

        kernel_num = [32, 32]
        hidden_size = [256]

        # fully connected
        flatten_view = tf.reshape(input_view, [-1, np.prod([v.value for v in input_view.shape[1:]])])
        h_view = tf.layers.dense(flatten_view, units=hidden_size[0], activation=tf.nn.relu)

        h_emb = tf.layers.dense(input_feature,  units=hidden_size[0], activation=tf.nn.relu)

        dense = tf.concat([h_view, h_emb], axis=1)
        dense = tf.layers.dense(dense, units=hidden_size[0] * 2, activation=tf.nn.relu)

        if self.use_comm:
            dense = self._commnet(num_agent, dense, dense.shape[-1].value)

        policy = tf.layers.dense(dense, units=self.num_actions, activation=tf.nn.softmax)
        policy = tf.clip_by_value(policy, 1e-10, 1-1e-10)
        value = tf.layers.dense(dense, units=1)
        value = tf.reshape(value, (-1,))
        advantage = tf.stop_gradient(reward - value)

        action_mask = tf.one_hot(action, self.num_actions)

        log_policy = tf.log(policy + 1e-6)
        log_prob = tf.reduce_sum(log_policy * action_mask, axis=1)
        pg_loss = -tf.reduce_mean(advantage * log_prob)
        vf_loss = self.value_coef * tf.reduce_mean(tf.square(reward - value))
        neg_entropy = self.ent_coef * tf.reduce_mean(tf.reduce_sum(policy * log_policy, axis=1))
        total_loss = pg_loss + vf_loss + neg_entropy

        # train op (clip gradient)
        optimizer = tf.train.AdamOptimizer(learning_rate=self.learning_rate)
        gradients, variables = zip(*optimizer.compute_gradients(total_loss))
        gradients, _ = tf.clip_by_global_norm(gradients, 5.0)
        self.train_op = optimizer.apply_gradients(zip(gradients, variables))

        train_op = tf.train.AdamOptimizer(learning_rate=self.learning_rate).minimize(total_loss)

        self.input_view = input_view
        self.input_feature = input_feature
        self.action     = action
        self.reward     = reward
        self.num_agent  = num_agent

        self.policy, self.value = policy, value
        self.train_op = train_op
        self.pg_loss, self.vf_loss, self.reg_loss = pg_loss, vf_loss, neg_entropy
        self.total_loss = total_loss
define computation graph of network

        Parameters
        ----------
        view_space: tuple
        feature_space: tuple
            the input shape
        
python/magent/builtin/tf_model/a2c.py