code: def _build_continuous_net(self, input_layer, action_space):
      num_actions = action_space.shape
      self.actions.append(
          tf.placeholder(
              tf.float32, [None, num_actions], name="actions"
          )
      )
  
      # output activation function
      if np.all(action_space.max_abs_range < np.inf):
          # bounded actions
          self.output_scale = action_space.max_abs_range
          self.continuous_output_activation = self.activation_function
      else:
          # unbounded actions
          self.output_scale = 1
          self.continuous_output_activation = None
  
      # mean
      pre_activation_policy_values_mean = self.dense_layer(num_actions)(
          input_layer, name="fc_mean"
      )
      policy_values_mean = self.continuous_output_activation(
          pre_activation_policy_values_mean
      )
      self.policy_mean = tf.multiply(
          policy_values_mean, self.output_scale, name="output_mean"
      )
  
      self.output.append(self.policy_mean)
  
      # standard deviation
      if isinstance(
          self.exploration_policy, ContinuousEntropyParameters
      ):
          # the stdev is an output of the network and uses a softplus activation as defined in A3C
          policy_values_std = self.dense_layer(num_actions)(
              input_layer,
              kernel_initializer=normalized_columns_initializer(0.01),
              name="fc_std",
          )
          self.policy_std = (
              tf.nn.softplus(policy_values_std, name="output_variance")
              + eps
          )
  
          self.output.append(self.policy_std)
      else:
          # the stdev is an externally given value
          # Warning: we need to explicitly put this variable in the local variables collections, since defining
          # it as not trainable puts it for some reason in the global variables collections. If this is not done,
          # the variable won't be initialized and when working with multiple workers they will get stuck.
          self.policy_std = tf.Variable(
              np.ones(num_actions),
              dtype="float32",
              trainable=False,
              name="policy_stdev",
              collections=[tf.GraphKeys.LOCAL_VARIABLES],
          )
  
          # assign op for the policy std
          self.policy_std_placeholder = tf.placeholder(
              "float32", (num_actions,)
          )
          self.assign_policy_std = tf.assign(
              self.policy_std, self.policy_std_placeholder
          )
  
      # define the distributions for the policy and the old policy
      policy_distribution = (
          tf.contrib.distributions.MultivariateNormalDiag(
              self.policy_mean, self.policy_std
          )
      )
      self.policy_distributions.append(policy_distribution)
  
      if self.is_local:
          # add a squared penalty on the squared pre-activation features of the action
          if self.action_penalty and self.action_penalty != 0:
              self.regularizations += [
                  self.action_penalty
                  * tf.reduce_mean(
                      tf.square(pre_activation_policy_values_mean)
                  )
              ]
  
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 4 for calling the PolicyHead obj's underlying member method code with example usage: obj._build_continuous_net(input_layer, action_space) without return types