class_docstr: Adds PyTorch specific functions.
class_docstr_tok: ["Adds","PyTorch","specific","functions","."]
docstr: Get loss function corresponding to the keyword.
docstr_tok: ["Get","loss","function","corresponding","to","the","keyword","."]
code: def get_loss(self, dist_type):
      """Get loss function corresponding to the keyword."""
      if dist_type == "binary":
          # Use sigmoid as last layer
          return torch.nn.BCELoss(reduction="mean")
      elif dist_type == "category":
          # Use logsoftmax as last layer
          return torch.nn.CrossEntropyLoss(reduction="mean")
      elif dist_type == "continuous":
          return torch.nn.MSELoss(reduction="mean")
      super(PytorchEngine, self).get_loss(dist_type)
  
file_path: fairlearn/fairlearn/adversarial/_pytorch_engine.py
imports: from ._backend_engine import BackendEngine
  from ._constants import _MODEL_UNRECOGNIZED_STR, _MODEL_UNRECOGNIZED_ITEM
label_desc: Use image node_id 7 for calling the PytorchEngine obj's underlying member method code with example usage: obj.get_loss(dist_type) and returns: torch, torch, torch