Skip to content

Instantly share code, notes, and snippets.

@gaphex
Last active June 20, 2019 13:46
Show Gist options
  • Save gaphex/16fac5f6c2e7aed58a4be6d0dd813d93 to your computer and use it in GitHub Desktop.
Save gaphex/16fac5f6c2e7aed58a4be6d0dd813d93 to your computer and use it in GitHub Desktop.
top_k distances and indices retrieval
top_k = 3
top_neg_dists, top_indices = tf.math.top_k(tf.negative(distance), k=top_k)
top_dists = tf.negative(top_neg_dists)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment