class_docstr: A simple vector decoder to reproduce non-image (1D vector) observations.
  
  Wraps an MLP for mean parameter computations and a Gaussian distribution,
  from which we then sample using these mean values and a fixed stddev of 1.0.
docstr: Initializes a VectorDecoder instance.
  
  Args:
      model_size: The "Model Size" used according to [1] Appendinx B.
          Determines the exact size of the underlying MLP.
      observation_space: The observation space to decode back into. This must
          be a Box of shape (d,), where d >= 1.
docstr_tok: ["Initializes","a","VectorDecoder","instance",".","Args",":","model_size",":","The","``","Model","Size","''","used","according","to","[","1","]","Appendinx","B.","Determines","the","exact","size","of","the","underlying","MLP",".","observation_space",":","The","observation","space","to","decode","back","into",".","This","must","be","a","Box","of","shape","(","d",",",")",",","where","d",">","=","1","."]
code: def __init__(
      self,
      *,
      model_size: Optional[str] = "XS",
      observation_space: gym.Space,
  ):
      """Initializes a VectorDecoder instance.
  
      Args:
          model_size: The "Model Size" used according to [1] Appendinx B.
              Determines the exact size of the underlying MLP.
          observation_space: The observation space to decode back into. This must
              be a Box of shape (d,), where d >= 1.
      """
      super().__init__(name="vector_decoder")
  
      self.model_size = model_size
  
      assert (
          isinstance(observation_space, gym.spaces.Box)
          and len(observation_space.shape) == 1
      )
  
      self.mlp = MLP(
          model_size=model_size,
          output_layer_size=observation_space.shape[0],
      )
  
      # Trace self.call.
      dl_type = (
          tf.keras.mixed_precision.global_policy().compute_dtype
          or tf.float32
      )
      self.call = tf.function(
          input_signature=[
              tf.TensorSpec(
                  shape=[None, get_gru_units(model_size)], dtype=dl_type
              ),
              tf.TensorSpec(
                  shape=[
                      None,
                      get_num_z_categoricals(model_size),
                      get_num_z_classes(model_size),
                  ],
                  dtype=dl_type,
              ),
          ]
      )(self.call)
  
file_path: ray/rllib/algorithms/dreamerv3/tf/models/components/vector_decoder.py
imports: from typing import Optional
  import gymnasium
  from ray.rllib.algorithms.dreamerv3.tf.models.components.mlp import MLP
  from ray.rllib.algorithms.dreamerv3.utils import get_gru_units, get_num_z_categoricals, get_num_z_classes
  from ray.rllib.utils.framework import try_import_tf
label_desc: Use image node_id 1 to create a new VectorDecoder object from inherited base classes: tf.keras with example: obj = VectorDecoder()