class_docstr: modified from https://github.com/MalongTech/research-ms-loss/
  Args:
      alpha: The exponential weight for positive pairs
      beta: The exponential weight for negative pairs
      base: The shift in the exponent applied to both positive and negative pairs
code: def _compute_loss(self, mat, pos_mask, neg_mask):
      pos_exp = self.distance.margin(mat, self.base)
      neg_exp = self.distance.margin(self.base, mat)
      pos_loss = (1.0 / self.alpha) * lmu.logsumexp(
          self.alpha * pos_exp, keep_mask=pos_mask.bool(), add_one=True
      )
      neg_loss = (1.0 / self.beta) * lmu.logsumexp(
          self.beta * neg_exp, keep_mask=neg_mask.bool(), add_one=True
      )
      return {
          "loss": {
              "losses": pos_loss + neg_loss,
              "indices": c_f.torch_arange_from_size(mat),
              "reduction_type": "element",
          }
      }
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/losses/multi_similarity_loss.py
imports: from ..distances import CosineSimilarity
  from ..utils import common_functions
  from ..utils import loss_and_miner_utils
  from .generic_pair_loss import GenericPairLoss
label_desc: Use image node_id 2 for calling the MultiSimilarityLoss obj's underlying member method code with example usage: obj._compute_loss(mat, pos_mask, neg_mask) and returns: dict