View source on GitHub |
Compute the pairwise distances matrix.
tf_agents.bandits.agents.utils.compute_pairwise_distances(
input_vecs: tf_agents.typing.types.Tensor
) -> tf_agents.typing.types.Tensor
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.
|