Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix CN docs: api/paddle/metric/accuracy_cn.html #6166

Conversation

linzeyang
Copy link
Contributor

@linzeyang linzeyang commented Sep 5, 2023

@paddle-bot
Copy link

paddle-bot bot commented Sep 5, 2023

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-6166.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:飞桨文档预览工具

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Sep 6, 2023
@@ -7,16 +7,16 @@ accuracy

accuracy layer。参考 https://en.wikipedia.org/wiki/Precision_and_recall

使用输入和标签计算准确率。如果正确的标签在 topk 个预测值里,则计算结果加 1。注意:输出正确率的类型由 input 类型决定,input 和 lable 的类型可以不一样。
使用 input 和 label 计算准确率。如果正确的 label 在 top k 个预测值里,则计算结果加 1。注意:输出正确率的类型由 input 的类型决定,input 和 label 的类型可以不一样。
Copy link
Collaborator

Choose a reason for hiding this comment

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

主要是「注解」部分用统一的格式,参考:https://www.paddlepaddle.org.cn/documentation/docs/zh/dev_guides/api_contributing_guides/api_docs_guidelines_cn.html#zhujie

英文的「注解」也同步进行修改

Suggested change
使用 input 和 label 计算准确率。如果正确的 label 在 top k 个预测值里,则计算结果加 1。注意:输出正确率的类型由 input 的类型决定,input 和 label 的类型可以不一样。
使用 input 和 label 计算准确率。如果正确的 label 在 top k 个预测值里,则计算结果加 1。
.. note::
输出正确率的类型由 input 的类型决定,input 和 label 的类型可以不一样。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

主要是「注解」部分用统一的格式,参考:https://www.paddlepaddle.org.cn/documentation/docs/zh/dev_guides/api_contributing_guides/api_docs_guidelines_cn.html#zhujie

英文的「注解」也同步进行修改

您好,中文文档部分已修改。英文的文档应该是从 Paddle 的代码生成,所以应该在Paddle的仓库中提PR对吗?

Copy link
Collaborator

Choose a reason for hiding this comment

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

您好,中文文档部分已修改。英文的文档应该是从 Paddle 的代码生成,所以应该在Paddle的仓库中提PR对吗?

是的,英文API文档是在每个 api 源码的 doc string 里

Comment on lines 15 to 19
- **input** (Tensor)-数据类型为 float32,float64 的 Tensor。accuracy layer 的输入,即网络的预测值。shape 为 ``[sample_number, class_dim]`` 。
- **label** (Tensor)-数据类型为 int64,int32 的 Tensor。数据集的标签。shape 为 ``[sample_number, 1]`` 。
- **k** (int,可选) - 数据类型为 int64,int32。取每个类别中 top k 个预测值用于计算,默认值为 1。
- **correct** (Tensor,可选) - 数据类型为 int64,int32 的 Tensor。正确预测值的个数,默认值为 None。
- **total** (Tensor,可选) - 数据类型为 int64,int32 的 Tensor。总共的预测值,默认值为 None。
Copy link
Collaborator

Choose a reason for hiding this comment

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

顺序换一下,先描述参数是什么,再描述数据类型、默认值,参考 https://www.paddlepaddle.org.cn/documentation/docs/zh/dev_guides/api_contributing_guides/api_docs_guidelines_cn.html#id5

- **input** (Tensor)-accuracy layer 的输入,即网络的预测值。数据类型为 float32,float64 的 Tensor, shape 为 ``[sample_number, class_dim]`` 。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这部分也已经修改。

Copy link
Collaborator

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

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

LGTM for docs
相关英文修改附在该PR描述里

@sunzhongkai588 sunzhongkai588 merged commit 557d125 into PaddlePaddle:develop Sep 13, 2023
@linzeyang linzeyang deleted the fix/api/paddle/metric/accuracy_cn.html branch September 13, 2023 05:29
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants