class_docstr: Cross entropy loss function for image classification tasks
  
  Args:
      opts: command-line arguments
class_docstr_tok: ["Cross","entropy","loss","function","for","image","classification","tasks","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.classification.cross_entropy.ignore_index"
      )
      self.use_class_wts = getattr(
          opts, "loss.classification.cross_entropy.class_weights"
      )
      self.label_smoothing = getattr(
          opts, "loss.classification.cross_entropy.label_smoothing"
      )
  
file_path: ml-cvnets/loss_fn/classification/cross_entropy.py
imports: import argparse
  from torch import Tensor
  from torch.nn import functional
  from loss_fn import LOSS_REGISTRY
  from loss_fn.classification.base_classification_criteria import BaseClassificationCriteria
  from loss_fn.utils.class_weighting import compute_class_weights
label_desc: Use image node_id 1 to create a new CrossEntropy object from inherited base classes: BaseClassificationCriteria with example: obj = CrossEntropy(opts)