tf.math.in_top_k( predictions, targets, k, name=None )
Says whether the targets are in the top
This outputs a
batch_size bool array, an entry
true if the
prediction for the target class is among the top
k predictions among
all predictions for example
i. Note that the behavior of
TopK op in its handling of ties; if multiple classes have the
same prediction value and straddle the top-
k boundary, all of those
classes are considered to be in the top
More formally, let
\(predictions_i\) be the predictions for all classes for example
\(targets_i\) be the target class for example
\(out_i\) be the output for example
Tensor. Must be one of the following types:
batch_sizevector of class ids.
int. Number of top elements to look at for computing precision.
name: A name for the operation (optional).
Tensor of type
bool. Computed Precision at
k as a