- paddle.static. accuracy ( input, label, k=1, correct=None, total=None )
accuracy layer. Refer to the https://en.wikipedia.org/wiki/Precision_and_recall This function computes the accuracy using the input and label. If the correct label occurs in top k predictions, then correct will increment by one. Note: the dtype of accuracy is determined by input. the input and label dtype can be different. :param input: The input of accuracy layer, which is the predictions of network. A Tensor with type float32,float64.
The shape is
label (Tensor) – The label of dataset. Tensor with type int32,int64. The shape is
k (int) – The top k predictions for each class will be checked. Data type is int64 or int32.
correct (Tensor) – The correct predictions count. A Tensor with type int64 or int32.
total (Tensor) – The total entries count. A tensor with type int64 or int32.
The correct rate. A Tensor with type float32.
- Return type