Created
July 13, 2018 02:43
-
-
Save hanxiao/7067560cdfb14a70709596a4ff1cfd43 to your computer and use it in GitHub Desktop.
get mean rank of positive labels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_pos_mean_rank(self, score, label): | |
_, d = tf.nn.top_k(score, k=self.size_support) | |
f = tf.gather(label, d) | |
g = tf.where(tf.not_equal(f, 0)) | |
return tf.reduce_mean(g) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment