class_docstr: The main tf-keras model containing all necessary components for DreamerV3.
  
  Includes:
  - The world model with encoder, decoder, sequence-model (RSSM), dynamics
  (generates prior z-state), and "posterior" model (generates posterior z-state).
  Predicts env dynamics and produces dreamed trajectories for actor- and critic
  learning.
  - The actor network (policy).
  - The critic network for value function prediction.
class_docstr_tok: ["The","main","tf-keras","model","containing","all","necessary","components","for","DreamerV3",".","Includes",":","-","The","world","model","with","encoder",",","decoder",",","sequence-model","(","RSSM",")",",","dynamics","(","generates","prior","z-state",")",",","and","``","posterior","''","model","(","generates","posterior","z-state",")",".","Predicts","env","dynamics","and","produces","dreamed","trajectories","for","actor-","and","critic","learning",".","-","The","actor","network","(","policy",")",".","-","The","critic","network","for","value","function","prediction","."]
docstr: Performs an exploratory action computation step given obs and states.
  
  Note that all input data should not have a time rank (only a batch dimension).
  
  Args:
      observations: The current environment observation with shape (B, ...).
      previous_states: Dict with keys `a`, `h`, and `z` used as input to the RSSM
          to produce the next h-state, from which then to compute the action
          using the actor network. All values in the dict should have shape
          (B, ...) (no time rank).
      is_first: Batch of is_first flags. These should be True if a new episode
          has been started at the current timestep (meaning `observations` is the
          reset observation from the environment).
docstr_tok: ["Performs","an","exploratory","action","computation","step","given","obs","and","states",".","Note","that","all","input","data","should","not","have","a","time","rank","(","only","a","batch","dimension",")",".","Args",":","observations",":","The","current","environment","observation","with","shape","(","B",",","...",")",".","previous_states",":","Dict","with","keys","`","a","`",",","`","h","`",",","and","`","z","`","used","as","input","to","the","RSSM","to","produce","the","next","h-state",",","from","which","then","to","compute","the","action","using","the","actor","network",".","All","values","in","the","dict","should","have","shape","(","B",",","...",")","(","no","time","rank",")",".","is_first",":","Batch","of","is_first","flags",".","These","should","be","True","if","a","new","episode","has","been","started","at","the","current","timestep","(","meaning","`","observations","`","is","the","reset","observation","from","the","environment",")","."]
code: def forward_exploration(
      self, observations, previous_states, is_first, training=None
  ):
      """Performs an exploratory action computation step given obs and states.
  
      Note that all input data should not have a time rank (only a batch dimension).
  
      Args:
          observations: The current environment observation with shape (B, ...).
          previous_states: Dict with keys `a`, `h`, and `z` used as input to the RSSM
              to produce the next h-state, from which then to compute the action
              using the actor network. All values in the dict should have shape
              (B, ...) (no time rank).
          is_first: Batch of is_first flags. These should be True if a new episode
              has been started at the current timestep (meaning `observations` is the
              reset observation from the environment).
      """
      # Perform one step in the world model (starting from `previous_state` and
      # using the observations to yield a current (posterior) state).
      states = self.world_model.forward_inference(
          observations=observations,
          previous_states=previous_states,
          is_first=is_first,
      )
      # Compute action using our actor network and the current states.
      actions, _ = self.actor(h=states["h"], z=states["z"])
      return actions, {"h": states["h"], "z": states["z"], "a": actions}
  
file_path: ray/python/ray/rllib/algorithms/dreamerv3/tf/models/dreamer_model.py
imports: import re
  import gymnasium
  import numpy
  from ray.rllib.algorithms.dreamerv3.tf.models.disagree_networks import DisagreeNetworks
  from ray.rllib.algorithms.dreamerv3.tf.models.actor_network import ActorNetwork
  from ray.rllib.algorithms.dreamerv3.tf.models.critic_network import CriticNetwork
  from ray.rllib.algorithms.dreamerv3.tf.models.world_model import WorldModel
  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
  from ray.rllib.utils.tf_utils import inverse_symlog
label_desc: Use image node_id 4 for calling the DreamerModel obj's underlying member method code with example usage: obj.forward_exploration(observations, previous_states, is_first, training) and returns: actions,  dict