From e098271d58acd21ab3a3d004d9515df0e8899836 Mon Sep 17 00:00:00 2001 From: Ainavo Date: Wed, 28 Jun 2023 10:42:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9COPY-FROM=20No.=2015=20regula?= =?UTF-8?q?rizer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/paddle/regularizer.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/paddle/regularizer.py b/python/paddle/regularizer.py index e10bde313fda5..9a746cb4bf53c 100644 --- a/python/paddle/regularizer.py +++ b/python/paddle/regularizer.py @@ -65,6 +65,7 @@ class L1Decay(WeightDecayRegularizer): Examples: .. code-block:: python + :name: code-example1 # Example1: set Regularizer in optimizer import paddle @@ -84,6 +85,9 @@ class L1Decay(WeightDecayRegularizer): momentum.step() momentum.clear_grad() + .. code-block:: python + :name: code-example2 + # Example2: set Regularizer in parameters # Set L1 regularization in parameters. # Global regularizer does not take effect on my_conv2d for this case. @@ -172,6 +176,7 @@ class L2Decay(WeightDecayRegularizer): Examples: .. code-block:: python + :name: code-example1 # Example1: set Regularizer in optimizer import paddle @@ -190,6 +195,8 @@ class L2Decay(WeightDecayRegularizer): momentum.step() momentum.clear_grad() + .. code-block:: python + :name: code-example2 # Example2: set Regularizer in parameters # Set L2 regularization in parameters. # Global regularizer does not take effect on my_conv2d for this case.