class_docstr: Output layer for pair (two-tower) regression models. Accepts two embedding tensors,
  and computes cosine similarity. The loss is between regression label and cosine
  similarity.
docstr: Args:
      logits (Tuple[torch.Tensor, torch.Tensor]): Logits returned from pairwise
          model
      target (torch.Tensor): Float target to compute loss against
      context (Optional[Dict[str, Any]]): Context is a dictionary from data
          handler
      reduce (bool): Whether to reduce loss over the batch. Defaults to True.
  
  Returns:
      torch.Tensor: Model loss.
docstr_tok: ["Args",":","logits","(","Tuple","[","torch.Tensor",",","torch.Tensor","]",")",":","Logits","returned","from","pairwise","model","target","(","torch.Tensor",")",":","Float","target","to","compute","loss","against","context","(","Optional","[","Dict","[","str",",","Any","]","]",")",":","Context","is","a","dictionary","from","data","handler","reduce","(","bool",")",":","Whether","to","reduce","loss","over","the","batch",".","Defaults","to","True",".","Returns",":","torch.Tensor",":","Model","loss","."]
code: def get_loss(
      self,
      logits: Tuple[torch.Tensor, torch.Tensor],
      target: torch.Tensor,
      context: Optional[Dict[str, Any]] = None,
      reduce: bool = True,
  ) -> torch.Tensor:
      """
      Args:
          logits (Tuple[torch.Tensor, torch.Tensor]): Logits returned from pairwise
              model
          target (torch.Tensor): Float target to compute loss against
          context (Optional[Dict[str, Any]]): Context is a dictionary from data
              handler
          reduce (bool): Whether to reduce loss over the batch. Defaults to True.
  
      Returns:
          torch.Tensor: Model loss.
      """
      pred, _ = self.get_pred(logits)
      return self.loss_fn(pred, target, reduce)
  
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  import torch
  from pytext.config.component import create_loss
  from pytext.loss import MAELoss, MSELoss
  from pytext.utils.usage import log_class_usage
  from .output_layer_base import OutputLayerBase
label_desc: Use image node_id 3 for calling the PairwiseCosineRegressionOutputLayer obj's underlying member method code with example usage: obj.get_loss(logits, target, context, reduce) and returns: self