code: def mean_confidence_penalty(
      probabilities: torch.Tensor, num_classes: int
  ) -> torch.Tensor:
      max_entropy = torch.log(torch.tensor(num_classes))
      # clipping needed for avoiding log(0) = -inf
      entropy_per_class, _ = torch.max(
          -probabilities
          * torch.log(torch.clamp(probabilities, 1e-10, 1)),
          dim=0,
      )
      entropy = torch.sum(entropy_per_class, -1)
      penalty = (max_entropy - entropy) / max_entropy
      return torch.mean(penalty)
  
label_desc: Use image node_id 2 for calling a global function with example usage: mean_confidence_penalty(probabilities, num_classes) and returns: torch