tfa.losses.metric_learning.angular_distance

View source on GitHub

Computes the angular distance matrix.

output[i, j] = 1 - cosine_similarity(feature[i, :], feature[j, :])

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

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