Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tf_agents.bandits.agents.utils.compute_pairwise_distances

View source on GitHub

Compute the pairwise distances matrix.

tf_agents.bandits.agents.utils.compute_pairwise_distances(
    input_vecs
)

Given input embedding vectors, this utility computes the (squared) pairwise distances matrix.

Args:

  • input_vecs: a Tensor. Input embedding vectors (one per row).

Returns:

The (squared) pairwise distances matrix. A dense float Tensor of shape [num_vectors, num_vectors], where num_vectors is the number of input embedding vectors.