class_docstr: A generalized version of all possible networks implemented using tensorflow.
class_docstr_tok: ["A","generalized","version","of","all","possible","networks","implemented","using","tensorflow","."]
docstr: Given a head type, creates the head and returns it
  :param head_params: the parameters of the head to create
  :param head_idx: the head index
  :return: the head
docstr_tok: ["Given","a","head","type",",","creates","the","head","and","returns","it",":","param","head_params",":","the","parameters","of","the","head","to","create",":","param","head_idx",":","the","head","index",":","return",":","the","head"]
code: def get_output_head(self, head_params: HeadParameters, head_idx: int):
      """
      Given a head type, creates the head and returns it
      :param head_params: the parameters of the head to create
      :param head_idx: the head index
      :return: the head
      """
      mod_name = head_params.parameterized_class_name
      head_path = head_params.path
      head_params_copy = copy.copy(head_params)
      head_params_copy.activation_function = (
          utils.get_activation_function(
              head_params_copy.activation_function
          )
      )
      head_params_copy.is_training = self.is_training
      return dynamic_import_and_instantiate_module_from_params(
          head_params_copy,
          path=head_path,
          extra_kwargs={
              "agent_parameters": self.ap,
              "spaces": self.spaces,
              "network_name": self.network_wrapper_name,
              "head_idx": head_idx,
              "is_local": self.network_is_local,
          },
      )
  
imports: import copy
  from types import MethodType
  from typing import Dict, List, Union
  import numpy
  import tensorflow
  from rl_coach.architectures.embedder_parameters import InputEmbedderParameters
  from rl_coach.architectures.head_parameters import HeadParameters
  from rl_coach.architectures.middleware_parameters import MiddlewareParameters
  from rl_coach.architectures.tensorflow_components.architecture import TensorFlowArchitecture
  from rl_coach.architectures.tensorflow_components import utils
  from rl_coach.base_parameters import AgentParameters, Device, DeviceType, EmbeddingMergerType
  from rl_coach.core_types import PredictionType
  from rl_coach.logger import screen
  from rl_coach.spaces import SpacesDefinition, PlanarMapsObservationSpace, TensorObservationSpace
  from rl_coach.utils import get_all_subclasses, dynamic_import_and_instantiate_module_from_params, indent_string
label_desc: Use image node_id 8 for calling the GeneralTensorFlowNetwork obj's underlying member method code with example usage: obj.get_output_head(head_params, head_idx) and returns: dynamic_import_and_instantiate_module_from_params