class_docstr: Head for sentence-level classification tasks.
class_docstr_tok: ["Head","for","sentence-level","classification","tasks","."]
code: def __init__(
      self,
      input_dim,
      inner_dim,
      num_classes,
      activation_fn,
      pooler_dropout,
      do_spectral_norm=False,
  ):
      super().__init__()
      self.dense = nn.Linear(input_dim, inner_dim)
      self.activation_fn = utils.get_activation_fn(activation_fn)
      self.dropout = nn.Dropout(p=pooler_dropout)
      self.out_proj = nn.Linear(inner_dim, num_classes)
  
      if do_spectral_norm:
          self.out_proj = torch.nn.utils.spectral_norm(self.out_proj)
  
imports: import logging
  from typing import Optional
  import torch
  import torch.nn
  from fairseq import utils
  from fairseq.models import register_model, register_model_architecture
  from fairseq.models.transformer import TransformerModel
  from fairseq.modules.transformer_sentence_encoder import init_bert_params
  from .hub_interface import BARTHubInterface
label_desc: Use image node_id 1 to create a new BARTClassificationHead object from inherited base classes: nn with example: obj = BARTClassificationHead(input_dim, inner_dim, num_classes, activation_fn, pooler_dropout, do_spectral_norm)