class_docstr: Cross entropy loss for the task of semantic segmentation.
  
  Args:
      opts: command-line arguments
code: def __init__(self, opts: argparse.Namespace, *args, **kwargs) -> None:
      super().__init__(opts, *args, **kwargs)
      self.ignore_idx = getattr(
          opts, "loss.segmentation.cross_entropy.ignore_index"
      )
      self.use_class_wts = getattr(
          opts, "loss.segmentation.cross_entropy.class_weights"
      )
      self.aux_wt = getattr(
          opts, "loss.segmentation.cross_entropy.aux_weight"
      )
      self.label_smoothing = getattr(
          opts, "loss.segmentation.cross_entropy.label_smoothing"
      )
  
file_path: ml-cvnets/loss_fn/segmentation/cross_entropy.py
imports: import argparse
  from typing import Any, Mapping, Optional, Tuple, Union
  from torch import Tensor
  from torch.nn import functional
  from loss_fn import LOSS_REGISTRY
  from loss_fn.segmentation.base_segmentation_criteria import BaseSegmentationCriteria
  from loss_fn.utils.class_weighting import compute_class_weights
  from utils import logger
label_desc: Use image node_id 1 to create a new SegCrossEntropy object from inherited base classes: BaseSegmentationCriteria with example: obj = SegCrossEntropy(opts)