Implement a EuclideanDistance object.
forward(self, mat_1: Tensor, mat_2: Tensor)¶
Returns the squared euclidean distance between each element in mat_1 and each element in mat_2.
- mat_1 (torch.Tensor) – matrix of shape (n_1, n_features)
- mat_2 (torch.Tensor) – matrix of shape (n_2, n_features)
dist – distance matrix of shape (n_1, n_2)
Implement a EuclideanMean object.
forward(self, data: Tensor)¶
Performs a forward pass through the network.
Parameters: data (torch.Tensor) – The input data, as a float tensor Returns: The encoded output, as a float tensor Return type: torch.Tensor