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: :param agent_parameters: the agent parameters
  :param spaces: the spaces definition of the agent
  :param name: the name of the network
  :param global_network: the global network replica that is shared between all the workers
  :param network_is_local: is the network global (shared between workers) or local (dedicated to the worker)
  :param network_is_trainable: is the network trainable (we can apply gradients on it)
docstr_tok: [":","param","agent_parameters",":","the","agent","parameters",":","param","spaces",":","the","spaces","definition","of","the","agent",":","param","name",":","the","name","of","the","network",":","param","global_network",":","the","global","network","replica","that","is","shared","between","all","the","workers",":","param","network_is_local",":","is","the","network","global","(","shared","between","workers",")","or","local","(","dedicated","to","the","worker",")",":","param","network_is_trainable",":","is","the","network","trainable","(","we","can","apply","gradients","on","it",")"]
code: def __init__(
      self,
      agent_parameters: AgentParameters,
      spaces: SpacesDefinition,
      name: str,
      global_network=None,
      network_is_local: bool = True,
      network_is_trainable: bool = False,
  ):
      """
      :param agent_parameters: the agent parameters
      :param spaces: the spaces definition of the agent
      :param name: the name of the network
      :param global_network: the global network replica that is shared between all the workers
      :param network_is_local: is the network global (shared between workers) or local (dedicated to the worker)
      :param network_is_trainable: is the network trainable (we can apply gradients on it)
      """
      self.global_network = global_network
      self.network_is_local = network_is_local
      self.network_wrapper_name = name.split("/")[0]
      self.network_parameters = agent_parameters.network_wrappers[
          self.network_wrapper_name
      ]
      self.num_heads_per_network = (
          1
          if self.network_parameters.use_separate_networks_per_head
          else len(self.network_parameters.heads_parameters)
      )
      self.num_networks = (
          1
          if not self.network_parameters.use_separate_networks_per_head
          else len(self.network_parameters.heads_parameters)
      )
  
      self.gradients_from_head_rescalers = []
      self.gradients_from_head_rescalers_placeholders = []
      self.update_head_rescaler_value_ops = []
  
      self.adaptive_learning_rate_scheme = None
      self.current_learning_rate = None
  
      # init network modules containers
      self.input_embedders = []
      self.output_heads = []
      super().__init__(
          agent_parameters,
          spaces,
          name,
          global_network,
          network_is_local,
          network_is_trainable,
      )
  
      self.available_return_types = self._available_return_types()
      self.is_training = None
  
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 3 to create a new GeneralTensorFlowNetwork object from inherited base classes: TensorFlowArchitecture with example: obj = GeneralTensorFlowNetwork(agent_parameters, spaces, name, global_network, network_is_local, network_is_trainable)