class_docstr: Implement a HyperbolicDistance object.
docstr: Returns the squared euclidean distance between each element in mat_1 and each element in mat_2.
  
  Parameters
  ----------
  mat_1: torch.Tensor
      matrix of shape (n_1, n_features)
  mat_2: torch.Tensor
      matrix of shape (n_2, n_features)
  
  Returns:
  -------
  dist: torch.Tensor
      distance matrix of shape (n_1, n_2)
docstr_tok: ["Returns","the","squared","euclidean","distance","between","each","element","in","mat_1","and","each","element","in","mat_2",".","Parameters","--","--","--","--","--","mat_1",":","torch.Tensor","matrix","of","shape","(","n_1",",","n_features",")","mat_2",":","torch.Tensor","matrix","of","shape","(","n_2",",","n_features",")","Returns",":","--","--","--","-","dist",":","torch.Tensor","distance","matrix","of","shape","(","n_1",",","n_2",")"]
code: def forward(self, mat_1: Tensor, mat_2: Tensor) -> Tensor:
      """Returns the squared euclidean distance between each element in mat_1 and each element in mat_2.
  
      Parameters
      ----------
      mat_1: torch.Tensor
          matrix of shape (n_1, n_features)
      mat_2: torch.Tensor
          matrix of shape (n_2, n_features)
  
      Returns:
      -------
      dist: torch.Tensor
          distance matrix of shape (n_1, n_2)
  
      """
      # Get projected 1st dimension
      mat_1_x_0 = torch.sqrt(1 + mat_1.pow(2).sum(dim=1, keepdim=True))
      mat_2_x_0 = torch.sqrt(1 + mat_2.pow(2).sum(dim=1, keepdim=True))
  
      # Compute bilinear form
      left = mat_1_x_0.mm(mat_2_x_0.t())  # n_1 x n_2
      right = mat_1[:, 1:].mm(mat_2[:, 1:].t())  # n_1 x n_2
  
      # Arcosh
      return arccosh(left - right).pow(2)
  
file_path: flair/flair/nn/distance/hyperbolic.py
imports: import torch
  from torch import Tensor, nn
label_desc: Use image node_id 1 for calling the HyperbolicDistance obj's underlying member method code with example usage: obj.forward(mat_1, mat_2) and returns: arccosh