class_docstr: Deep supervision head takes all feature maps and applies 1x1 convolution to each of them.
code: def __init__(
      self,
      input_spec: FeatureMapsSpecification,
      num_classes: int,
      output_name_prefix: Optional[str] = None,
  ):
      super().__init__(input_spec)
      self.heads = nn.ModuleList(
          [
              conv1x1(channel, num_classes)
              for channel in input_spec.channels
          ]
      )
      self.output_spec = FeatureMapsSpecification(
          channels=tuple(
              [num_classes] * len(input_spec.channels),
          ),
          strides=input_spec.strides,
      )
      self.output_name_prefix = output_name_prefix
  
file_path: pytorch-toolbelt/pytorch_toolbelt/modules/heads/deep_supervision.py
imports: from typing import List, Dict, Optional, Callable
  import torch
  import torch.nn
  from pytorch_toolbelt.datasets import name_for_stride
  from pytorch_toolbelt.modules.simple import conv1x1
  from pytorch_toolbelt.modules.interfaces import AbstractHead, FeatureMapsSpecification
label_desc: Use image node_id 1 to create a new DeepSupervisionHead object from inherited base classes: AbstractHead with example: obj = DeepSupervisionHead(input_spec, num_classes, output_name_prefix)