class_docstr: Provides a mapping of spaces and action heads to the respective probability distributions to be used.
  
  This ensures full flexibility for specifying different distributions to the same gym action space type.
  (e.g. One gym.spaces.Box space could be modeled with a Beta another one with a DiagonalGaussian distribution.)
  It allows to add and register arbitrary custom distributions.
  
  :param action_space: The dictionary action space.
  :param distribution_mapper_config: A Distribution mapper configuration (for details see the docs).
class_docstr_tok: ["Provides","a","mapping","of","spaces","and","action","heads","to","the","respective","probability","distributions","to","be","used",".","This","ensures","full","flexibility","for","specifying","different","distributions","to","the","same","gym","action","space","type",".","(","e.g",".","One","gym.spaces.Box","space","could","be","modeled","with","a","Beta","another","one","with","a","DiagonalGaussian","distribution",".",")","It","allows","to","add","and","register","arbitrary","custom","distributions",".",":","param","action_space",":","The","dictionary","action","space",".",":","param","distribution_mapper_config",":","A","Distribution","mapper","configuration","(","for","details","see","the","docs",")","."]
docstr: Creates a dictionary probability distribution for a given logits dictionary.
  
  :param logits_dict: A logits dictionary [action_head: action_logits] to parameterize the distribution from.
  :param temperature: Controls the sampling behaviour.
                          * 1.0 corresponds to unmodified sampling
                          * smaller than 1.0 concentrates the action distribution towards deterministic sampling
  :return: (DictProbabilityDistribution) the respective instance of a DictProbabilityDistribution.
docstr_tok: ["Creates","a","dictionary","probability","distribution","for","a","given","logits","dictionary",".",":","param","logits_dict",":","A","logits","dictionary","[","action_head",":","action_logits","]","to","parameterize","the","distribution","from",".",":","param","temperature",":","Controls","the","sampling","behaviour",".","*","1.0","corresponds","to","unmodified","sampling","*","smaller","than","1.0","concentrates","the","action","distribution","towards","deterministic","sampling",":","return",":","(","DictProbabilityDistribution",")","the","respective","instance","of","a","DictProbabilityDistribution","."]
code: def logits_dict_to_distribution(
      self, logits_dict: Dict[str, torch.Tensor], temperature: float
  ) -> DictProbabilityDistribution:
      """Creates a dictionary probability distribution for a given logits dictionary.
  
      :param logits_dict: A logits dictionary [action_head: action_logits] to parameterize the distribution from.
      :param temperature: Controls the sampling behaviour.
                              * 1.0 corresponds to unmodified sampling
                              * smaller than 1.0 concentrates the action distribution towards deterministic sampling
      :return: (DictProbabilityDistribution) the respective instance of a DictProbabilityDistribution.
      """
  
      # iterate all action heads contained in logits dictionary
      distribution_dict = dict()
      for action_head, action_logits in logits_dict.items():
          assert isinstance(action_logits, torch.Tensor)
          distribution_dict[
              action_head
          ] = self.action_head_distribution(
              action_head=action_head,
              logits=action_logits,
              temperature=temperature,
          )
  
      return DictProbabilityDistribution(
          distribution_dict=distribution_dict
      )
  
file_path: maze/maze/distributions/distribution_mapper.py
imports: from typing import Dict, Tuple, Any, Sequence
  import torch
  from gym import spaces
  from maze.core.utils.factory import Factory, CollectionOfConfigType
  from maze.distributions.bernoulli import BernoulliProbabilityDistribution
  from maze.distributions.categorical import CategoricalProbabilityDistribution
  from maze.distributions.dict import DictProbabilityDistribution
  from maze.distributions.gaussian import DiagonalGaussianProbabilityDistribution
  from maze.distributions.multi_categorical import MultiCategoricalProbabilityDistribution
  from maze.distributions.torch_dist import TorchProbabilityDistribution
label_desc: Use image node_id 4 for calling the DistributionMapper obj's underlying member method code with example usage: obj.logits_dict_to_distribution(logits_dict, temperature) and returns: DictProbabilityDistribution