From 773ee87c60f551b5751f4f0cf3a7e6a1e1be8d99 Mon Sep 17 00:00:00 2001 From: InsaneOnion <93063038+InsaneOnion@users.noreply.github.com> Date: Thu, 24 Aug 2023 10:31:24 +0800 Subject: [PATCH] Fixed a mismatch between Chinese and English documents for the CrossEntropyLoss #50424 (#56469) * Fixed a mismatch between Chinese and English documents for the CrossEntropyLoss #50424 * Update python/paddle/nn/layer/loss.py Co-authored-by: Nyakku Shigure * Update python/paddle/nn/layer/loss.py Co-authored-by: Nyakku Shigure * update fix * update fix * Uniform Context Format --------- Co-authored-by: Nyakku Shigure --- python/paddle/nn/layer/loss.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/paddle/nn/layer/loss.py b/python/paddle/nn/layer/loss.py index 944d5a59a4b..b4da52f4ad2 100644 --- a/python/paddle/nn/layer/loss.py +++ b/python/paddle/nn/layer/loss.py @@ -231,7 +231,7 @@ class CrossEntropyLoss(Layer): where, N is the number of samples and C is the number of categories. - 2.3.2. If the 'weight' parameter is not 'None', the weighted average value of the previous result will be returned + 2.3.2. If the ``weight`` parameter is ``None`` , the weighted average value of the previous result will be returned 1. Hard labels (soft_label = False) @@ -302,6 +302,7 @@ class CrossEntropyLoss(Layer): Examples: .. code-block:: python + :name: code-example1 >>> # hard labels >>> import paddle @@ -321,6 +322,7 @@ class CrossEntropyLoss(Layer): 5.33697682) .. code-block:: python + :name: code-example2 >>> # soft labels >>> import paddle -- GitLab