class_docstr: Hard distillation using cross-entropy for classification tasks. Given an input sample, hard-labels
  are generated from a teacher and cross-entropy loss is computed between hard-labels and student model's output.
  
  Args:
      opts: command-line arguments
class_docstr_tok: ["Hard","distillation","using","cross-entropy","for","classification","tasks",".","Given","an","input","sample",",","hard-labels","are","generated","from","a","teacher","and","cross-entropy","loss","is","computed","between","hard-labels","and","student","model","'s","output",".","Args",":","opts",":","command-line","arguments"]
code: def add_arguments(
      cls, parser: argparse.ArgumentParser
  ) -> argparse.ArgumentParser:
      if cls != HardDistillationLoss:
          # Don't re-register arguments in subclasses that don't override `add_arguments()`.
          return parser
  
      group = parser.add_argument_group(title=cls.__name__)
      group.add_argument(
          "--loss.distillation.hard-distillation.topk",
          type=int,
          default=1,
          help=f"Distill top-k labels from teacher when in {cls.__name__}. Defaults to 1.",
      )
      group.add_argument(
          "--loss.distillation.hard-distillation.label-smoothing",
          type=float,
          default=0.0,
          help=f"Specifies the amount of smoothing when computing the classification loss in {cls.__name__}, "
          f"where 0.0 means no smoothing. Defaults to 0.0.",
      )
      return parser
  
file_path: ml-cvnets/loss_fn/distillation/hard_distillation.py
imports: import argparse
  import torch
  from torch import Tensor
  from torch.nn import functional
  from loss_fn import LOSS_REGISTRY
  from loss_fn.distillation.base_distillation import BaseDistillationCriteria
  from utils import logger
label_desc: Use image node_id 2 for calling the HardDistillationLoss obj's underlying member method code with example usage: obj.add_arguments(cls, parser) and returns: parser, parser