class_docstr: Calculates the categorical cross entropy.
  
  The metric computes the cross entropy when there are multiple classes.
  It outputs a numpy array.
docstr: Initializes categorical cross entropy metric.
  
  Args:
    name: The name of the metric.
    from_logits: (Optional) Whether output is expected to be a logits tensor.
      By default, we consider that output encodes a probability distribution.
    label_smoothing: Float in [0, 1]. If > `0` then smooth the labels. For
      example, if `0.1`, use `0.1 / num_classes` for non-target labels and
      `0.9 + 0.1 / num_classes` for target labels.
docstr_tok: ["Initializes","categorical","cross","entropy","metric",".","Args",":","name",":","The","name","of","the","metric",".","from_logits",":","(","Optional",")","Whether","output","is","expected","to","be","a","logits","tensor",".","By","default",",","we","consider","that","output","encodes","a","probability","distribution",".","label_smoothing",":","Float","in","[","0",",","1","]",".","If",">","`","0","`","then","smooth","the","labels",".","For","example",",","if","`","0.1","`",",","use","`","0.1","\/","num_classes","`","for","non-target","labels","and","`","0.9","+","0.1","\/","num_classes","`","for","target","labels","."]
code: def __init__(
      self,
      name: str = CATEGORICAL_CROSSENTROPY_NAME,
      from_logits: bool = False,
      label_smoothing: float = 0.0,
  ):
      """Initializes categorical cross entropy metric.
  
      Args:
        name: The name of the metric.
        from_logits: (Optional) Whether output is expected to be a logits tensor.
          By default, we consider that output encodes a probability distribution.
        label_smoothing: Float in [0, 1]. If > `0` then smooth the labels. For
          example, if `0.1`, use `0.1 / num_classes` for non-target labels and
          `0.9 + 0.1 / num_classes` for target labels.
      """
      super().__init__(
          metric_util.merge_per_key_computations(
              _categorical_cross_entropy_computations
          ),
          name=name,
          from_logits=from_logits,
          label_smoothing=label_smoothing,
      )
  
imports: import abc
  import dataclasses
  from typing import Iterable, Optional, Dict
  import apache_beam
  import numpy
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 1 to create a new CategoricalCrossEntropy object from inherited base classes: metric_types with example: obj = CategoricalCrossEntropy(name, from_logits, label_smoothing)