tfa.losses.metric_learning.pairwise_distance

View source on GitHub

Computes the pairwise distance matrix with numerical stability.

output[i, j] = || feature[i, :] - feature[j, :] ||_2

feature 2-D Tensor of size [number of data, feature dimension].
squared Boolean, whether or not to square the pairwise distances.

pairwise_distances 2-D Tensor of size [number of data, number of data].