code: def report_dreamed_eval_trajectory_vs_samples(
      *,
      results,
      dream_data,
      sample,
      burn_in_T,
      dreamed_T,
      dreamer_model,
      symlog_obs: bool = True,
  ):
      # Obs MSE.
      dreamed_obs_T_B = reconstruct_obs_from_h_and_z(
          h_t0_to_H=dream_data["h_states_t0_to_H_BxT"],
          z_t0_to_H=dream_data["z_states_prior_t0_to_H_BxT"],
          dreamer_model=dreamer_model,
          obs_dims_shape=sample[SampleBatch.OBS].shape[2:],
      )
      t0 = burn_in_T - 1
      tH = t0 + dreamed_T
      # Observation MSE and - if applicable - images comparisons.
      mse_sampled_vs_dreamed_obs = _report_obs(
          results=results,
          # Have to transpose b/c dreamed data is time-major.
          computed_float_obs_B_T_dims=np.transpose(
              dreamed_obs_T_B,
              axes=[1, 0] + list(range(2, len(dreamed_obs_T_B.shape))),
          ),
          sampled_obs_B_T_dims=sample[SampleBatch.OBS][:, t0 : tH + 1],
          descr_prefix="EVALUATION",
          descr_obs=f"dreamed_prior_H{dreamed_T}",
          symlog_obs=symlog_obs,
      )
  
      # Reward MSE.
      _report_rewards(
          results=results,
          computed_rewards=dream_data["rewards_dreamed_t0_to_H_BxT"],
          sampled_rewards=sample[SampleBatch.REWARDS][:, t0 : tH + 1],
          descr_prefix="EVALUATION",
          descr_reward=f"dreamed_prior_H{dreamed_T}",
      )
  
      # Continues MSE.
      _report_continues(
          results=results,
          computed_continues=dream_data[
              "continues_dreamed_t0_to_H_BxT"
          ],
          sampled_continues=(1.0 - sample["is_terminated"])[
              :, t0 : tH + 1
          ],
          descr_prefix="EVALUATION",
          descr_cont=f"dreamed_prior_H{dreamed_T}",
      )
      return mse_sampled_vs_dreamed_obs
  
file_path: ray/python/ray/rllib/algorithms/dreamerv3/utils/summaries.py
imports: import numpy
  from ray.rllib.algorithms.dreamerv3.utils.debugging import create_cartpole_dream_image, create_frozenlake_dream_image
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.tf_utils import inverse_symlog
label_desc: Use image node_id 5 for calling a global function with example usage: report_dreamed_eval_trajectory_vs_samples() and returns: mse_sampled_vs_dreamed_obs