def in_top_k(predictions, targets, k):
'''Returns whether the `targets` are in the top `k` `predictions`
# Arguments
predictions: A tensor of shape batch_size x classess and type float32.
targets: A tensor of shape batch_size and type int32 or int64.
k: An int, number of top elements to consider.
# Returns
A tensor of shape batch_size and type bool. output_i is True if
targets_i is within top-k values of predictions_i
'''
return tf.nn.in_top_k(predictions, targets, k)
# CONVOLUTIONS
评论列表
文章目录