code: def _build_module(self, input_layer):
      self.actions = []
      self.input = self.actions
      self.policy_distributions = []
      self.output = []
  
      action_spaces = [self.spaces.action]
      if isinstance(self.spaces.action, CompoundActionSpace):
          action_spaces = self.spaces.action.sub_action_spaces
  
      # create a compound action network
      for action_space_idx, action_space in enumerate(action_spaces):
          with tf.variable_scope(
              "sub_action_{}".format(action_space_idx)
          ):
              if isinstance(action_space, DiscreteActionSpace):
                  # create a discrete action network (softmax probabilities output)
                  self._build_discrete_net(input_layer, action_space)
              elif isinstance(action_space, BoxActionSpace):
                  # create a continuous action network (bounded mean and stdev outputs)
                  self._build_continuous_net(input_layer, action_space)
  
      if self.is_local:
          # add entropy regularization
          if self.beta:
              self.entropy = tf.add_n(
                  [
                      tf.reduce_mean(dist.entropy())
                      for dist in self.policy_distributions
                  ]
              )
              self.regularizations += [
                  -tf.multiply(
                      self.beta,
                      self.entropy,
                      name="entropy_regularization",
                  )
              ]
  
          # calculate loss
          self.action_log_probs_wrt_policy = tf.add_n(
              [
                  dist.log_prob(action)
                  for dist, action in zip(
                      self.policy_distributions, self.actions
                  )
              ]
          )
          self.advantages = tf.placeholder(
              tf.float32, [None], name="advantages"
          )
          self.target = self.advantages
          self.loss = -tf.reduce_mean(
              self.action_log_probs_wrt_policy * self.advantages
          )
          tf.losses.add_loss(self.loss_weight[0] * self.loss)
  
file_path: coach/rl_coach/architectures/tensorflow_components/heads/policy_head.py
imports: import numpy
  import tensorflow
  from rl_coach.architectures.tensorflow_components.layers import Dense
  from rl_coach.architectures.tensorflow_components.heads.head import Head, normalized_columns_initializer
  from rl_coach.base_parameters import AgentParameters
  from rl_coach.core_types import ActionProbabilities
  from rl_coach.exploration_policies.continuous_entropy import ContinuousEntropyParameters
  from rl_coach.spaces import DiscreteActionSpace, BoxActionSpace, CompoundActionSpace
  from rl_coach.spaces import SpacesDefinition
  from rl_coach.utils import eps, indent_string
label_desc: Use image node_id 2 for calling the PolicyHead obj's underlying member method code with example usage: obj._build_module(input_layer) without return types