class_docstr: Base class for perception default model builders.
  
  :param modality_config: dictionary mapping perception modalities to blocks and block config parameters.
  :param observation_modality_mapping: A mapping of observation keys to perception modalities.
  :param shared_embedding_keys: The shared embedding keys to use as an input to the critic network where the value
      can be one of the following:
      - None, empty list or dict of empty lists: No shared embeddings are used.
      - A list of str values: The shared embedding keys to use for creating the critic network in each substep
      (the same keys).
      - A dict of lists: Here the keys have to refer to the step-keys of the environment, the corresponding lists
      specify the input keys to the critic network in this step.
class_docstr_tok: ["Base","class","for","perception","default","model","builders",".",":","param","modality_config",":","dictionary","mapping","perception","modalities","to","blocks","and","block","config","parameters",".",":","param","observation_modality_mapping",":","A","mapping","of","observation","keys","to","perception","modalities",".",":","param","shared_embedding_keys",":","The","shared","embedding","keys","to","use","as","an","input","to","the","critic","network","where","the","value","can","be","one","of","the","following",":","-","None",",","empty","list","or","dict","of","empty","lists",":","No","shared","embeddings","are","used",".","-","A","list","of","str","values",":","The","shared","embedding","keys","to","use","for","creating","the","critic","network","in","each","substep","(","the","same","keys",")",".","-","A","dict","of","lists",":","Here","the","keys","have","to","refer","to","the","step-keys","of","the","environment",",","the","corresponding","lists","specify","the","input","keys","to","the","critic","network","in","this","step","."]
docstr: Init the shared embedding keys as a dict using the step_keys of the environment.
  
  :param step_keys: the step keys of the environment steps
docstr_tok: ["Init","the","shared","embedding","keys","as","a","dict","using","the","step_keys","of","the","environment",".",":","param","step_keys",":","the","step","keys","of","the","environment","steps"]
code: def init_shared_embedding_keys(
      self, step_keys: Iterable[StepKeyType]
  ) -> None:
      """Init the shared embedding keys as a dict using the step_keys of the environment.
  
      :param step_keys: the step keys of the environment steps
      """
      # Init shared embedding keys
      self.shared_embedding_keys = (
          list()
          if self.shared_embedding_keys is None
          else self.shared_embedding_keys
      )
      if isinstance(self.shared_embedding_keys, (list, ListConfig)):
          self.shared_embedding_keys = {
              step_key: list(self.shared_embedding_keys)
              for step_key in step_keys
          }
      else:
          assert isinstance(
              self.shared_embedding_keys, (dict, DictConfig)
          ), (f"type: " f"{type(self.shared_embedding_keys)}")
          self.shared_embedding_keys = {
              step_key: list(shared_keys)
              for step_key, shared_keys in self.shared_embedding_keys.items()
          }
      self.use_shared_embedding: Dict[StepKeyType, bool] = {
          step_key: len(shared_keys) > 0
          for step_key, shared_keys in self.shared_embedding_keys.items()
      }
  
file_path: maze/maze/perception/builders/base.py
imports: from abc import abstractmethod, ABC
  from typing import Dict, Union, Any, Optional, List, Iterable
  import numpy
  from gym import spaces
  from omegaconf import ListConfig, DictConfig
  from maze.core.env.structured_env import StepKeyType
  from maze.perception.blocks.inference import InferenceBlock
label_desc: Use image node_id 2 for calling the BaseModelBuilder obj's underlying member method code with example usage: obj.init_shared_embedding_keys(step_keys) without return types