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 __init__(self, opts: argparse.Namespace, *args, **kwargs) -> None:
      top_k = getattr(opts, "loss.distillation.hard_distillation.topk")
      if top_k < 1:
          logger.error(
              f"The value of top-k should be greater than 0. Got: {top_k}"
          )
  
      label_smoothing = getattr(
          opts, "loss.distillation.hard_distillation.label_smoothing"
      )
      if not (0.0 <= label_smoothing < 1.0):
          logger.error(
              f"The value of label smoothing should be between 0 and 1. Got: {label_smoothing}"
          )
  
      super().__init__(opts, *args, **kwargs)
  
      self.topk = top_k
      self.label_smoothing = label_smoothing
  
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 1 to create a new HardDistillationLoss object from inherited base classes: BaseDistillationCriteria with example: obj = HardDistillationLoss(opts)