class_docstr: Multi step soft actor critic.
  
  :param algorithm_config: Algorithm options.
  :param learner_model: Structured torch actor critic to train.
  :param distributed_actors: Distributed actors for collection of training rollouts.
  :param model_selection: Optional model selection class, receives model evaluation results.
  :param evaluator: The evaluator to use.
class_docstr_tok: ["Multi","step","soft","actor","critic",".",":","param","algorithm_config",":","Algorithm","options",".",":","param","learner_model",":","Structured","torch","actor","critic","to","train",".",":","param","distributed_actors",":","Distributed","actors","for","collection","of","training","rollouts",".",":","param","model_selection",":","Optional","model","selection","class",",","receives","model","evaluation","results",".",":","param","evaluator",":","The","evaluator","to","use","."]
docstr: Compute the entropy loss.
  
  :param action_probs: The probabilities of the individual actions.
  :param action_log_probs: The log probabilities of the individual actions.
  :return: The entropy loss.
docstr_tok: ["Compute","the","entropy","loss",".",":","param","action_probs",":","The","probabilities","of","the","individual","actions",".",":","param","action_log_probs",":","The","log","probabilities","of","the","individual","actions",".",":","return",":","The","entropy","loss","."]
code: def _compute_entropy_loss(
      self,
      action_probs: Dict[
          Union[str, int], Union[torch.Tensor, Dict[str, torch.Tensor]]
      ],
      action_log_probs: Dict[
          Union[str, int], Union[torch.Tensor, Dict[str, torch.Tensor]]
      ],
  ) -> Dict[Union[str, int], torch.Tensor]:
      """Compute the entropy loss.
  
      :param action_probs: The probabilities of the individual actions.
      :param action_log_probs: The log probabilities of the individual actions.
      :return: The entropy loss.
      """
      entropy_losses = dict()
      for step_key in self.sub_step_keys:
          if self.learner_model.critic.only_discrete_spaces[step_key]:
              assert isinstance(self.target_entropy[step_key], dict)
              entropy_losses_per_step = list()
              for action_key, action_probs_step in action_probs[
                  step_key
              ].items():
                  action_log_probs_step_action = action_log_probs[
                      step_key
                  ][action_key]
                  entropy_loss_per_action = (
                      torch.matmul(
                          action_probs_step.unsqueeze(-2).detach(),
                          (
                              -self.curr_log_entropy_coef[step_key]
                              * (
                                  self.target_entropy[step_key][
                                      action_key
                                  ]
                                  + action_log_probs_step_action
                              ).detach()
                          ).unsqueeze(-1),
                      )
                      .squeeze(-1)
                      .squeeze(-1)
                  )
                  entropy_losses_per_step.append(
                      entropy_loss_per_action
                  )
              # Sum together all action heads and average over batch
              entropy_losses[step_key] = (
                  torch.stack(entropy_losses_per_step).sum(0).mean()
              )
          else:
              assert not isinstance(self.target_entropy[step_key], dict)
              entropy_losses[step_key] = torch.mean(
                  -self.curr_log_entropy_coef[step_key]
                  * (
                      self.target_entropy[step_key]
                      + action_log_probs[step_key]
                  ).detach()
              )
      return entropy_losses
  
imports: import sys
  import time
  from typing import Union, Optional, BinaryIO, Dict, Tuple, List
  import numpy
  import torch
  import torch.nn
  from gym import spaces
  from maze.core.agent.torch_actor_critic import TorchActorCritic
  from maze.core.annotations import override
  from maze.core.env.base_env_events import BaseEnvEvents
  from maze.core.env.structured_env import ActorID
  from maze.core.log_stats.log_stats import increment_log_step, LogStatsLevel
  from maze.core.trajectory_recording.records.structured_spaces_record import StructuredSpacesRecord
  from maze.train.trainers.common.evaluators.rollout_evaluator import RolloutEvaluator
  from maze.train.trainers.common.model_selection.best_model_selection import BestModelSelection
  from maze.train.trainers.common.trainer import Trainer
  from maze.train.utils.train_utils import compute_gradient_norm
  from maze.utils.bcolors import BColors
  from maze.train.parallelization.distributed_actors.base_distributed_workers_with_buffer import BaseDistributedWorkersWithBuffer
  from maze.train.trainers.sac.sac_algorithm_config import SACAlgorithmConfig
  from maze.train.trainers.sac.sac_events import SACEvents
  from torch.distributions.utils import logits_to_probs
label_desc: Use image node_id 11 for calling the SAC obj's underlying member method code with example usage: obj._compute_entropy_loss(action_probs, action_log_probs) and returns: entropy_losses