docstr: Calculate the log probability of data given the current distribution.
  
  :param actions: actions, with int8 data type,
      of shape (1) if probs was (n_classes),
      of shape (batch_size) if probs was (batch_size, n_classes) and
      of shape (batch_size, time_step) if probs was (batch_size, time_step, n_classes)
  :return: log_probability,
      of shape (1) if probs was (n_classes),
      of shape (batch_size) if probs was (batch_size, n_classes) and
      of shape (batch_size, time_step) if probs was (batch_size, time_step, n_classes)
docstr_tok: ["Calculate","the","log","probability","of","data","given","the","current","distribution",".",":","param","actions",":","actions",",","with","int8","data","type",",","of","shape","(","1",")","if","probs","was","(","n_classes",")",",","of","shape","(","batch_size",")","if","probs","was","(","batch_size",",","n_classes",")","and","of","shape","(","batch_size",",","time_step",")","if","probs","was","(","batch_size",",","time_step",",","n_classes",")",":","return",":","log_probability",",","of","shape","(","1",")","if","probs","was","(","n_classes",")",",","of","shape","(","batch_size",")","if","probs","was","(","batch_size",",","n_classes",")","and","of","shape","(","batch_size",",","time_step",")","if","probs","was","(","batch_size",",","time_step",",","n_classes",")"]
code: def log_prob(self, actions: nd_sym_type) -> nd_sym_type:
      """
      Calculate the log probability of data given the current distribution.
  
      :param actions: actions, with int8 data type,
          of shape (1) if probs was (n_classes),
          of shape (batch_size) if probs was (batch_size, n_classes) and
          of shape (batch_size, time_step) if probs was (batch_size, time_step, n_classes)
      :return: log_probability,
          of shape (1) if probs was (n_classes),
          of shape (batch_size) if probs was (batch_size, n_classes) and
          of shape (batch_size, time_step) if probs was (batch_size, time_step, n_classes)
      """
      action_mask = actions.one_hot(depth=self.n_classes)
      action_probs = (self.probs * action_mask).sum(axis=-1)
      return action_probs.log()
  
imports: from typing import List, Tuple, Union
  from types import ModuleType
  import math
  import mxnet
  from mxnet.gluon import nn
  from rl_coach.base_parameters import AgentParameters
  from rl_coach.core_types import ActionProbabilities
  from rl_coach.spaces import SpacesDefinition, BoxActionSpace, DiscreteActionSpace
  from rl_coach.utils import eps
  from rl_coach.architectures.mxnet_components.heads.head import Head, HeadLoss, LossInputSchema, NormalizedRSSInitializer
  from rl_coach.architectures.mxnet_components.heads.head import LOSS_OUT_TYPE_LOSS, LOSS_OUT_TYPE_REGULARIZATION
  from rl_coach.architectures.mxnet_components.utils import hybrid_clip, broadcast_like
label_desc: Use image node_id 2 for calling the CategoricalDist obj's underlying member method code with example usage: obj.log_prob(actions) and returns: action_probs