class_docstr: Output layer for doc regression models. Currently only supports Mean Squared Error
  loss.
  
  Args:
      loss (MSELoss): config for MSE loss
      squash_to_unit_range (bool): whether to clamp the output to the range [0, 1],
          via a sigmoid.
docstr: Compute regression loss from logits and targets.
  
  Args:
      logit (torch.Tensor): Logits returned :class:`~pytext.models.Model`.
      target (torch.Tensor): True label/target to compute loss against.
      context (Optional[Dict[str, Any]]): Context is a dictionary of items
          that's passed as additional metadata by the
          :class:`~pytext.data.DataHandler`. Defaults to None.
      reduce (bool): Whether to reduce loss over the batch. Defaults to True.
  
  Returns:
      torch.Tensor: Model loss.
docstr_tok: ["Compute","regression","loss","from","logits","and","targets",".","Args",":","logit","(","torch.Tensor",")",":","Logits","returned",":","class",":","`","~pytext.models.Model","`",".","target","(","torch.Tensor",")",":","True","label\/target","to","compute","loss","against",".","context","(","Optional","[","Dict","[","str",",","Any","]","]",")",":","Context","is","a","dictionary","of","items","that","'s","passed","as","additional","metadata","by","the",":","class",":","`","~pytext.data.DataHandler","`",".","Defaults","to","None",".","reduce","(","bool",")",":","Whether","to","reduce","loss","over","the","batch",".","Defaults","to","True",".","Returns",":","torch.Tensor",":","Model","loss","."]
code: def get_loss(
      self,
      logit: torch.Tensor,
      target: torch.Tensor,
      context: Optional[Dict[str, Any]] = None,
      reduce: bool = True,
  ) -> torch.Tensor:
      """
      Compute regression loss from logits and targets.
  
      Args:
          logit (torch.Tensor): Logits returned :class:`~pytext.models.Model`.
          target (torch.Tensor): True label/target to compute loss against.
          context (Optional[Dict[str, Any]]): Context is a dictionary of items
              that's passed as additional metadata by the
              :class:`~pytext.data.DataHandler`. Defaults to None.
          reduce (bool): Whether to reduce loss over the batch. Defaults to True.
  
      Returns:
          torch.Tensor: Model loss.
      """
      logit, _ = self.get_pred(logit)
      return self.loss_fn(logit, 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 RegressionOutputLayer obj's underlying member method code with example usage: obj.get_loss(logit, target, context, reduce) and returns: self