code: def __init__(self, args, tgt_dict):
      super().__init__(args, tgt_dict)
      self.task_type = args.task_type
      assert self.task_type in [
          "lang",
          "domain",
      ], "invalid task_type: {}, should be either lang or domain".format(
          self.task_type
      )
      self.map_task_to_id(args.train_subset)
      self.encoder_head_prior = (
          float(args.decoder_attention_heads)
          / args.total_decoder_attention_heads
      )
      self.decoder_head_prior = (
          float(args.encoder_attention_heads)
          / args.total_encoder_attention_heads
      )
      self.kl_loss = HeadSelectionLoss(args)
  
file_path: fairseq/examples/attention_head_selection/src/speech_to_text_head_selection.py
imports: import torch
  from fairseq.optim.amp_optimizer import AMPOptimizer
  from fairseq.tasks import register_task
  from fairseq.tasks.speech_to_text import SpeechToTextTask
  from .data.speech_to_text_dataset_with_domain import SpeechToTextDatasetCreatorWithDomain
  from .loss.attention_head_selection import HeadSelectionLoss
label_desc: Use image node_id 2 to create a new SpeechToTextHeadSelectionTask object from inherited base classes: SpeechToTextTask with example: obj = SpeechToTextHeadSelectionTask(args, tgt_dict)