我有以下声明:
labels = tf.constant([1, 2, 5, 7, 3], dtype=tf.int64)
pred = tf.constant([1, 8, 2, 11, 3], dtype=tf.int64)
当我跑步时
metric = tf.metrics.average_precision_at_k(labels, pred, 5)
sess = tf.Session()
sess.run(tf.local_variables_initializer())
sess.run(metric)
我得到mean_average_precision
0.55
但是如果我创建以下常量
labels = tf.constant([80354115, 60265163, 10138163, 90299492, 10197671], dtype=tf.int64)
pred = tf.constant([80354115, 30297014, 60265163, 60296843, 10197671], dtype=tf.int64)
我得到mean_average_precision
0.0
。那是为什么?