dgs.models.metric.metric.EuclideanSquareMetric

class dgs.models.metric.metric.EuclideanSquareMetric(*args: Any, **kwargs: Any)[source]

Class to compute the squared Euclidean distance between two matrices.

Methods

__init__(*args: Any, **kwargs: Any) None
static forward(input1: torch.Tensor, input2: torch.Tensor) torch.Tensor[source]

Compute squared Euclidean distance between two matrices with a matching second dimension.

Parameters:
  • input1 – tensor of shape [a x E]

  • input2 – tensor of shape [b x E]

Returns:

tensor of shape [a x b] containing the distances.