From 97e87d2d40dcf6b5eede83f488d0d175301791b9 Mon Sep 17 00:00:00 2001 From: zhangjingwei <57820731+Ainavo@users.noreply.github.com> Date: Wed, 5 Jul 2023 16:03:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9COPY-FROM=20No.=2015=20regula?= =?UTF-8?q?rizer=20(#54926)?= 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 e10bde313fd..9a746cb4bf5 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. -- GitLab