class_docstr: Encapsulates multiple torch state action critics for training in structured environments.
  
  :param networks: Mapping of value functions (critic) to encapsulate.
  :param num_policies: The number of corresponding policies.
  :param device: Device the policy should be located on (cpu or cuda)
  :param only_discrete_spaces: A dict specifying if the action spaces w.r.t. the step only hold discrete action
                               spaces.
class_docstr_tok: ["Encapsulates","multiple","torch","state","action","critics","for","training","in","structured","environments",".",":","param","networks",":","Mapping","of","value","functions","(","critic",")","to","encapsulate",".",":","param","num_policies",":","The","number","of","corresponding","policies",".",":","param","device",":","Device","the","policy","should","be","located","on","(","cpu","or","cuda",")",":","param","only_discrete_spaces",":","A","dict","specifying","if","the","action","spaces","w.r.t",".","the","step","only","hold","discrete","action","spaces","."]
docstr: Predict the target q value for the next step.  :math:`V (st) := E_{at∼π}[Q(st, at) − α log(π(at |st))]`.
  
  :param next_observations: The next observations.
  :param next_actions: The next actions sampled from the policy.
  :param next_actions_logits: The logits of the next actions (only relevantt for the discrete case).
  :param next_actions_log_probs: The log probabilities of the actions.
  :param alpha: The alpha or entropy coefficient for each step.
  
  :return: A dict w.r.t. the step holding tensors representing the predicted next q value
docstr_tok: ["Predict","the","target","q","value","for","the","next","step",".",":","math",":","`","V","(","st",")",":","=","E_","{","at\u223c\u03c0","}","[","Q","(","st",",","at",")","\u2212","\u03b1","log","(","\u03c0","(","at","|st",")",")","]","`",".",":","param","next_observations",":","The","next","observations",".",":","param","next_actions",":","The","next","actions","sampled","from","the","policy",".",":","param","next_actions_logits",":","The","logits","of","the","next","actions","(","only","relevantt","for","the","discrete","case",")",".",":","param","next_actions_log_probs",":","The","log","probabilities","of","the","actions",".",":","param","alpha",":","The","alpha","or","entropy","coefficient","for","each","step",".",":","return",":","A","dict","w.r.t",".","the","step","holding","tensors","representing","the","predicted","next","q","value"]
code: def predict_next_q_values(
      self,
      next_observations: Dict[Union[str, int], Dict[str, torch.Tensor]],
      next_actions: Dict[Union[str, int], Dict[str, torch.Tensor]],
      next_actions_logits: Dict[
          Union[str, int], Dict[str, torch.Tensor]
      ],
      next_actions_log_probs: Dict[
          Union[str, int], Dict[str, torch.Tensor]
      ],
      alpha: Dict[Union[str, int], torch.Tensor],
  ) -> Dict[
      Union[str, int], Union[torch.Tensor, Dict[str, torch.Tensor]]
  ]:
      """Predict the target q value for the next step.  :math:`V (st) := E_{at∼π}[Q(st, at) − α log(π(at |st))]`.
  
      :param next_observations: The next observations.
      :param next_actions: The next actions sampled from the policy.
      :param next_actions_logits: The logits of the next actions (only relevantt for the discrete case).
      :param next_actions_log_probs: The log probabilities of the actions.
      :param alpha: The alpha or entropy coefficient for each step.
  
      :return: A dict w.r.t. the step holding tensors representing the predicted next q value
      """
  
imports: import copy
  import itertools
  from abc import abstractmethod
  from typing import Mapping, Union, List, Dict
  import torch
  from gym import spaces
  from torch import nn
  from torch.distributions.utils import logits_to_probs
  from maze.core.agent.state_action_critic import StateActionCritic
  from maze.core.agent.torch_model import TorchModel
  from maze.core.annotations import override
  from maze.core.wrappers.observation_preprocessing.preprocessors.one_hot import OneHotPreProcessor
  from maze.perception.blocks.inference import InferenceBlock
  from maze.perception.perception_utils import flatten_spaces, convert_to_numpy, convert_to_torch
  from maze.perception.weight_init import make_module_init_normc
  from maze.utils.bcolors import BColors
label_desc: Use image node_id 5 for calling the TorchStateActionCritic obj's underlying member method code with example usage: obj.predict_next_q_values(next_observations, next_actions, next_actions_logits, next_actions_log_probs, alpha) without return types