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.
  
  :param agent_parameters: containing algorithm parameters such as clip_likelihood_ratio_using_epsilon
      and beta_entropy.
  :param spaces: containing action spaces used for defining size of network output.
  :param network_name: name of head network. currently unused.
  :param head_type_idx: index of head network. currently unused.
  :param loss_weight: scalar used to adjust relative weight of loss (if using this loss with others).
  :param is_local: flag to denote if network is local. currently unused.
  :param activation_function: activation function to use between layers. currently unused.
  :param dense_layer: type of dense layer to use in network. currently unused.
docstr_tok: ["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",".",":","param","agent_parameters",":","containing","algorithm","parameters","such","as","clip_likelihood_ratio_using_epsilon","and","beta_entropy",".",":","param","spaces",":","containing","action","spaces","used","for","defining","size","of","network","output",".",":","param","network_name",":","name","of","head","network",".","currently","unused",".",":","param","head_type_idx",":","index","of","head","network",".","currently","unused",".",":","param","loss_weight",":","scalar","used","to","adjust","relative","weight","of","loss","(","if","using","this","loss","with","others",")",".",":","param","is_local",":","flag","to","denote","if","network","is","local",".","currently","unused",".",":","param","activation_function",":","activation","function","to","use","between","layers",".","currently","unused",".",":","param","dense_layer",":","type","of","dense","layer","to","use","in","network",".","currently","unused","."]
code: def __init__(
      self,
      agent_parameters: AgentParameters,
      spaces: SpacesDefinition,
      network_name: str,
      head_type_idx: int = 0,
      loss_weight: float = 1.0,
      is_local: bool = True,
      activation_function: str = "relu",
      dense_layer: None = None,
  ):
      """
      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.
  
      :param agent_parameters: containing algorithm parameters such as clip_likelihood_ratio_using_epsilon
          and beta_entropy.
      :param spaces: containing action spaces used for defining size of network output.
      :param network_name: name of head network. currently unused.
      :param head_type_idx: index of head network. currently unused.
      :param loss_weight: scalar used to adjust relative weight of loss (if using this loss with others).
      :param is_local: flag to denote if network is local. currently unused.
      :param activation_function: activation function to use between layers. currently unused.
      :param dense_layer: type of dense layer to use in network. currently unused.
      """
      super(Head, self).__init__()
      self.head_type_idx = head_type_idx
      self.network_name = network_name
      self.loss_weight = loss_weight
      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
      self._num_outputs = None
  
imports: from typing import Dict, List, Union, Tuple
  import mxnet
  from mxnet.initializer import Initializer, register
  from mxnet.gluon import nn, loss
  from mxnet.ndarray import NDArray
  from mxnet.symbol import Symbol
  from rl_coach.base_parameters import AgentParameters
  from rl_coach.spaces import SpacesDefinition
label_desc: Use image node_id 1 to create a new Head object from inherited base classes: nn with example: obj = Head(agent_parameters, spaces, network_name, head_type_idx, loss_weight, is_local, activation_function, dense_layer)