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 an input embedder parameters class, creates the input embedder and returns it
  :param input_name: the name of the input to the embedder (used for retrieving the shape). The input should
                     be a value within the state or the action.
  :param embedder_params: the parameters of the class of the embedder
  :return: the embedder instance
docstr_tok: ["Given","an","input","embedder","parameters","class",",","creates","the","input","embedder","and","returns","it",":","param","input_name",":","the","name","of","the","input","to","the","embedder","(","used","for","retrieving","the","shape",")",".","The","input","should","be","a","value","within","the","state","or","the","action",".",":","param","embedder_params",":","the","parameters","of","the","class","of","the","embedder",":","return",":","the","embedder","instance"]
code: def get_input_embedder(
      self, input_name: str, embedder_params: InputEmbedderParameters
  ):
      """
      Given an input embedder parameters class, creates the input embedder and returns it
      :param input_name: the name of the input to the embedder (used for retrieving the shape). The input should
                         be a value within the state or the action.
      :param embedder_params: the parameters of the class of the embedder
      :return: the embedder instance
      """
      allowed_inputs = copy.copy(self.spaces.state.sub_spaces)
      allowed_inputs["action"] = copy.copy(self.spaces.action)
      allowed_inputs["goal"] = copy.copy(self.spaces.goal)
  
      if input_name not in allowed_inputs.keys():
          raise ValueError(
              "The key for the input embedder ({}) must match one of the following keys: {}".format(
                  input_name, allowed_inputs.keys()
              )
          )
  
      emb_type = "vector"
      if isinstance(allowed_inputs[input_name], TensorObservationSpace):
          emb_type = "tensor"
      elif isinstance(
          allowed_inputs[input_name], PlanarMapsObservationSpace
      ):
          emb_type = "image"
  
      embedder_path = embedder_params.path(emb_type)
      embedder_params_copy = copy.copy(embedder_params)
      embedder_params_copy.is_training = self.is_training
      embedder_params_copy.activation_function = (
          utils.get_activation_function(
              embedder_params.activation_function
          )
      )
      embedder_params_copy.input_rescaling = (
          embedder_params_copy.input_rescaling[emb_type]
      )
      embedder_params_copy.input_offset = (
          embedder_params_copy.input_offset[emb_type]
      )
      embedder_params_copy.name = input_name
      module = dynamic_import_and_instantiate_module_from_params(
          embedder_params_copy,
          path=embedder_path,
          positional_args=[allowed_inputs[input_name].shape],
      )
      return module
  
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 6 for calling the GeneralTensorFlowNetwork obj's underlying member method code with example usage: obj.get_input_embedder(input_name, embedder_params) and returns: module