class_docstr: Base class for heads that can be attached to :class:`ClassyModel`.
  
  A head is a regular :class:`torch.nn.Module` that can be attached to a
  pretrained model. This enables a form of transfer learning: utilizing a
  model trained for one dataset to extract features that can be used for
  other problems. A head must be attached to a :class:`models.ClassyBlock`
  within a :class:`models.ClassyModel`.
docstr: Constructs a ClassyHead.
  
  Args:
      unique_id: A unique identifier for the head. Multiple instances of
          the same head might be attached to a model, and unique_id is used
          to refer to them.
  
      num_classes: Number of classes for the head.
docstr_tok: ["Constructs","a","ClassyHead",".","Args",":","unique_id",":","A","unique","identifier","for","the","head",".","Multiple","instances","of","the","same","head","might","be","attached","to","a","model",",","and","unique_id","is","used","to","refer","to","them",".","num_classes",":","Number","of","classes","for","the","head","."]
code: def __init__(
      self,
      unique_id: Optional[str] = None,
      num_classes: Optional[int] = None,
  ):
      """
      Constructs a ClassyHead.
  
      Args:
          unique_id: A unique identifier for the head. Multiple instances of
              the same head might be attached to a model, and unique_id is used
              to refer to them.
  
          num_classes: Number of classes for the head.
      """
      super().__init__()
      self.unique_id = unique_id or self.__class__.__name__
      self.num_classes = num_classes
  
imports: from typing import Any, Dict, Optional
  import torch.nn
label_desc: Use image node_id 1 to create a new ClassyHead object from inherited base classes: nn with example: obj = ClassyHead(unique_id, num_classes)