Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doc of accuracy function #7091

Closed
wants to merge 2 commits into from

Conversation

wanghaoshuang
Copy link
Contributor

fix #7090

label = fluid.layers.data(name="label", shape=[batch_size, 1],
dtype="int64")
prediction = fluid.layers.fc(input=layer_1, size=20, act="softmax")
acc = fluid.layers.accuracy(input=prediction, label=label, k=3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need examples on how to accumulate accuracy across batches.


Args:
input (Variable): The input variable which is a Tensor
with dims.size > 1. Usually, it is the output
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to explain the shape of this input, like: batch_size * topk.

with dims.size > 1. Usually, it is the output
of softmax operator.
label (Variable): The label variable which is a Tensor.
The last dim of label tensor must be 1.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last dim of label tensor must be 1.

Need more clear explain about the shape, same as below.

@wanghaoshuang wanghaoshuang deleted the acc_doc branch May 20, 2022 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doc of accuracy function should be polished
2 participants