美文网首页
tf.in_top_k()

tf.in_top_k()

作者: 律动的时间线 | 来源:发表于2017-11-11 10:28 被阅读0次

correct = tf.nn.in_top_k(prediction, target, K):

K --- 表示每个样本的预测结果的前K个最大的数里面是否含有target中的值

prediction  --- [batch_size,one_hot]    样本数量乘以预测的维度二维数组

target --- [batch_size]    长度为batch_size的一维数组

Return :

correct --- [batch_size]的bool类型的一维数组

function:

检测预测准确度,logits和labels的相等与否的数组:

Ps:

 在python中矩阵等同于一个二维数组,shape=(a.b)

一维数组 shape = (a,) 或参数shape=(a)

相关文章

  • tf.in_top_k()

    correct = tf.nn.in_top_k(prediction, target, K): K --- 表示...

网友评论

      本文标题:tf.in_top_k()

      本文链接:https://www.haomeiwen.com/subject/uujwmxtx.html