class_docstr: A head is the final part of the network. It takes the embedding from the middleware embedder and passes it through
  a neural network to produce the output of the network. There can be multiple heads in a network, and each one has
  an assigned loss function. The heads are algorithm dependent.
code: def __init__(
      self,
      agent_parameters: AgentParameters,
      spaces: SpacesDefinition,
      network_name: str,
      head_idx: int = 0,
      loss_weight: float = 1.0,
      is_local: bool = True,
      activation_function: str = "relu",
      dense_layer=Dense,
      is_training=False,
  ):
      self.head_idx = head_idx
      self.network_name = network_name
      self.network_parameters = agent_parameters.network_wrappers[
          self.network_name
      ]
      self.name = "head"
      self.output = []
      self.loss = []
      self.loss_type = []
      self.regularizations = []
      self.loss_weight = tf.Variable(
          [float(w) for w in force_list(loss_weight)],
          trainable=False,
          collections=[tf.GraphKeys.LOCAL_VARIABLES],
      )
      self.target = []
      self.importance_weight = []
      self.input = []
      self.is_local = is_local
      self.ap = agent_parameters
      self.spaces = spaces
      self.return_type = None
      self.activation_function = activation_function
      self.dense_layer = dense_layer
      if self.dense_layer is None:
          self.dense_layer = Dense
      else:
          self.dense_layer = convert_layer_class(self.dense_layer)
      self.is_training = is_training
  
imports: import numpy
  import tensorflow
  from tensorflow.python.ops.losses.losses_impl import Reduction
  from rl_coach.architectures.tensorflow_components.layers import Dense, convert_layer_class
  from rl_coach.base_parameters import AgentParameters
  from rl_coach.spaces import SpacesDefinition
  from rl_coach.utils import force_list
  from rl_coach.architectures.tensorflow_components.utils import squeeze_tensor
label_desc: Use image node_id 1 to create a new Head object from inherited base classes: object with example: obj = Head(agent_parameters, spaces, network_name, head_idx, loss_weight, is_local, activation_function, dense_layer, is_training)