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 middleware type, creates the middleware and returns it
  :param middleware_params: the paramaeters of the middleware class
  :return: the middleware instance
docstr_tok: ["Given","a","middleware","type",",","creates","the","middleware","and","returns","it",":","param","middleware_params",":","the","paramaeters","of","the","middleware","class",":","return",":","the","middleware","instance"]
code: def get_middleware(self, middleware_params: MiddlewareParameters):
      """
      Given a middleware type, creates the middleware and returns it
      :param middleware_params: the paramaeters of the middleware class
      :return: the middleware instance
      """
      mod_name = middleware_params.parameterized_class_name
      middleware_path = middleware_params.path
      middleware_params_copy = copy.copy(middleware_params)
      middleware_params_copy.activation_function = (
          utils.get_activation_function(
              middleware_params.activation_function
          )
      )
      middleware_params_copy.is_training = self.is_training
      module = dynamic_import_and_instantiate_module_from_params(
          middleware_params_copy, path=middleware_path
      )
      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 7 for calling the GeneralTensorFlowNetwork obj's underlying member method code with example usage: obj.get_middleware(middleware_params) and returns: module