code: def __init__(
      self,
      target_names: Optional[List[str]] = None,
      loss_fn: Union[
          BinaryCrossEntropyLoss,
          CosineEmbeddingLoss,
          MAELoss,
          MSELoss,
          NLLLoss,
      ] = None,
      score_threshold: bool = Config.score_threshold,
      score_type: OutputScore = Config.score_type,
  ):
      super().__init__(target_names, loss_fn)
      self.score_threshold = score_threshold
      self.score_type = score_type
      log_class_usage(__class__)
  
imports: from enum import IntEnum, unique
  from typing import Any, Dict, List, Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from pytext.config.component import create_loss
  from pytext.data.utils import Vocabulary
  from pytext.fields import FieldMeta
  from pytext.loss import BinaryCrossEntropyLoss, CosineEmbeddingLoss, MAELoss, MSELoss, NLLLoss
  from pytext.models.output_layers.output_layer_base import OutputLayerBase
  from pytext.utils.label import get_label_weights
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 2 to create a new PairwiseCosineDistanceOutputLayer object from inherited base classes: OutputLayerBase with example: obj = PairwiseCosineDistanceOutputLayer(target_names, loss_fn, score_threshold, score_type)