class_docstr: Base class for defining loss functions. Sub-classes must implement compute_loss function.
  
  Args:
      opts: command line arguments
class_docstr_tok: ["Base","class","for","defining","loss","functions",".","Sub-classes","must","implement","compute_loss","function",".","Args",":","opts",":","command","line","arguments"]
docstr: Add criterion-specific arguments to the parser.
docstr_tok: ["Add","criterion-specific","arguments","to","the","parser","."]
code: def add_arguments(
      cls, parser: argparse.ArgumentParser
  ) -> argparse.ArgumentParser:
      """Add criterion-specific arguments to the parser."""
      if cls != BaseCriteria:
          # Don't re-register arguments in subclasses that don't override `add_arguments()`.
          return parser
      group = parser.add_argument_group(cls.__name__)
  
      group.add_argument(
          "--loss.category",
          type=str,
          default=None,
          help="Loss function category (e.g., classification). Defaults to None.",
      )
      return parser
  
file_path: ml-cvnets/loss_fn/base_criteria.py
imports: import abc
  import argparse
  from typing import Any
  from torch import nn
  from utils import logger
label_desc: Use image node_id 2 for calling the BaseCriteria obj's underlying member method code with example usage: obj.add_arguments(cls, parser) and returns: parser, parser